home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / bbsdoors / ckit258.zip / CKIT.DOC < prev    next >
Text File  |  1993-06-01  |  193KB  |  4,841 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                        C-KIT DOOR building Toolkit Library
  14.  
  15.                                   Version 2.58
  16.  
  17.  
  18.  
  19.                                 Reference Manual
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.                                  Distributed By
  30.  
  31.                          Data-Comp Information Systems
  32.                                  P.O. Box 5895
  33.                           Maryville, Tenn. 37802-5895
  34.  
  35.  
  36.                 (615) 690-8231 (USR HST Dual Standard V.32bis 16.8)
  37.                 (615) 690-7968 (Hayes Ultra Series    V.32bis 14.4)
  38.                 (615) 690-7913 (USR HST Dual Standard V.32bis 14.4)
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.                               Copyright (c) 1989, 90, 91, 92 Rickie W. Belitz
  60.  
  61.  
  62.  
  63.  
  64.                                                               Introduction
  65.  
  66.                                    Introduction
  67.  
  68.        C-KIT Library is an extensive library of C runtime routines that
  69.        allow easy door program implementation using PCBoard 12.0 through
  70.        14.x, WILDCAT! systems, (all versions), GAP BBS, SPITFIRE BBS 3.0
  71.        and other systems using standard DOOR.SYS file along with RBBS-PC,
  72.        QuickBBS, Remote Access and other systems using DORINFOx.DEF files.
  73.        C-KIT 2.01 will also work properly with MikeBBS (MBBS) v9.9 and above.
  74.        CKIT will automatically work with the above system.  For systems
  75.        not listed above, CKIT can deal with them in one of two ways.
  76.        CKIT  can  utilize a file called GENERIC.SYS.    This is for
  77.        creating a system file for a system CKIT does not support. See
  78.        section on GENERIC.SYS for more information.  In addition,
  79.        CKIT will also accept a pointer to a structure that contains the
  80.        needed information for CKIT to operate.  This could be the result
  81.        of your program reading ANY BBS's system file. This structure will
  82.        allow C-KIT to work on ANY BBS system, providing the door author
  83.        reads the BBS file himself.
  84.  
  85.        Some other C-KIT Library's features include interrupt driven I/O,
  86.        16550AN UART support, FOSSIL support, Digiboard Support,provides
  87.        information available from the PCBoard .sys files, database files,
  88.        multi-node support (file sharing), multi-BBS support, local sysop
  89.        function keys and many more utilities are included for the door
  90.        author.
  91.  
  92.        The C-KIT Library routines are written entirely in Assembly language
  93.        using SLR's Optasm.  The routines make use of C library functions
  94.        when possible and are compatible with Microsoft C,  Microsoft QuickC,
  95.        TURBO C, and TURBO C++.
  96.  
  97.        C-KIT Library supports the small, medium and large models.
  98.  
  99.  
  100.        Microsoft is a registered trademark, and QuickC is a trademark of
  101.        the Microsoft Corporation.
  102.  
  103.        TURBO C   is a registered trademark of Borland International Inc.
  104.  
  105.        TURBO C++ is a registered trademark of Borland International Inc.
  106.  
  107.        PCBoard   is a registered trademark of Clark Development Company.
  108.  
  109.        WILDCAT!  is a registered trademark of Mustang Software.
  110.  
  111.        SPITFIRE  is a registered trademark of Buffalo Creek Software
  112.  
  113.        RBBS-PC   is copyright (c) Tom Mack,  Capital PC Software Exchange
  114.  
  115.        QUICKBBS  is copyright (c) Adam Hudson
  116.  
  117.        REMOTE ACCESS is copyright (c) Andrew Milner, Continental Software
  118.  
  119.        MBBS is copyright (c) Mike Anderson
  120.  
  121.        DigiBoard is copyright (c) DigiBoard,  Eden Prarie, MN
  122.  
  123.  
  124.                                                            Registration
  125.  
  126.        The unregistered library will display "Unregistered copy etc." as
  127.        part of the signoff message. The registered version eliminates this
  128.        signoff msg at the time the door is closed.  Please see the
  129.        registration information  below.  A lot of effort has gone into C-KIT,
  130.        to make sure it would operate reliably and with little effort
  131.        on the part of the door author.  If you find the program of use, please
  132.        register it and help support the Shareware method of program
  133.        distribution.   Registering will also help fund further development
  134.        of the libraries.
  135.  
  136.        C-KIT is being distributed as Shareware.
  137.  
  138.        The registration includes:
  139.  
  140.          ∙    A disk with the latest version of C-KIT, registered to you.
  141.  
  142.          .    Some small utility programs for easy door testing w/source.
  143.  
  144.          ∙    Self-Registration program for future releases of C-KIT
  145.  
  146.          ∙    Technical support via electronic mail
  147.  
  148.          .    A LARGE memory model of C-KIT.  (download from Data-Comp BBS)
  149.               (The LARGE model will also work as a HUGE model)
  150.  
  151.          .    Access to source code for reading other system files as they
  152.               become available.  All PCBoard source files are now available.
  153.  
  154.         For more information see the addresses, phone numbers listed
  155.         at the end of this document.
  156.  
  157.                                                           Global Variables
  158.  
  159.              Global Functions/Variable Naming Conventions
  160.  
  161.        The C-KIT Library defines a  number of variables and functions
  162.        in the c-kit header  file.  These have to be made public for
  163.        the linker to be able to resolve references to them.  Beginning
  164.        in C-KIT 2.0 ALL functions/variables available from the library
  165.        begin with the prefix "ck_".  This will help prevent any naming
  166.        conflicts with other globals in your source code.  Knowing that
  167.        all C-KIT's names begin with "ck_", you can prevent any collisions
  168.        with the public names contained in the library.  If this is of
  169.        little concern to you or if you do not like the names used in
  170.        the library because of this, then you can simply re-define
  171.        the names to any name you desire.  OLDCKIT.H does exactly this
  172.        for previous users of the library.  OLDCKIT.H re-defines the
  173.        new names to the old names used in the library.  If you included
  174.        OLDCKIT.H in your present source code, then the new library
  175.        names would work with no other changes to your present source code.
  176.  
  177.        Example:  Name desired   Library Name
  178.        =======  ===========     ============
  179.        #define  s_puts          ck_s_puts
  180.        #define  DUMP_USER       ck_DUMP_USER
  181.        #define  color           ck_color
  182.        #define  newline         ck_newline
  183.        #define  get_cmdline     ck_get_cmdline
  184.  
  185.        These would cause the compiler to reference the new name for all
  186.        references to old name.
  187.               do {
  188.                 color(green);
  189.                 s_puts("Command? ", NULL);
  190.                 get_cmdline();     /* read input into 'cmdline'  */
  191.                 newline();
  192.               } while( (DUMP_USER != TRUE) && ( strlen(cmdline) == 0 ));
  193.  
  194.  
  195.        See OLDCKIT.H and CKITDEMO.C, CKITDEMO.H.
  196.  
  197.        NOTE: The ONLY variable that does not have the "ck_" prefix is
  198.              the progname[]; array name in the CKIT.H file.
  199.  
  200.  
  201.                                                           Global Variables
  202.  
  203.                    Global Variables used by all BBS systems
  204.  
  205.        The C-KIT Library defines a  number of variables in the ckit.h
  206.        header  file.    Through  proper use,  these  variables  allow  the
  207.        programmer  to customize  the C-KIT  Library  functions to  meet
  208.        particular application program's needs.
  209.  
  210.        ck_DUMP_USER
  211.        -------------------------------------------------------------------
  212.        Defined As:    short ck_DUMP_USER;
  213.  
  214.        Description:   This variable will be set if the user hangs up,
  215.                       his/her time runs out, carrier is lost, or if the
  216.                       sysop wants to return the user to the BBS system using
  217.                       function key F8.  You should check this flag in all
  218.                       major loops in the door program.
  219.  
  220.  
  221.        ck_FORCEOFFHOOK
  222.        -------------------------------------------------------------------
  223.        Defined As:    short ck_FORCEOFFHOOK
  224.  
  225.        Description:   This variable should be set to TRUE or FALSE in the
  226.                       CKIT.H file.  If this variable is TRUE, the modem
  227.                       will be placed OFF-HOOK if carrier is dropped in the
  228.                       door before returning to the system.  If FORCEOFFHOOK
  229.                       is false, the door will not take the modem off-hook.
  230.                       See CKIT.H
  231.  
  232.        ck_USERFILE
  233.        -------------------------------------------------------------------
  234.        Defined As:    short ck_USERSFILE
  235.  
  236.        Description:   This variable should be set to TRUE or FALSE in the
  237.                       CKIT.H file.  If this variable is TRUE, C-KIT will
  238.                       open the Users file and those variables will be
  239.                       available.  If not, only the PCBOARD.SYS file will be
  240.                       opened and the user information will not be available.
  241.                       See CKIT.H.
  242.  
  243.        ck_option
  244.        ------------------------------------------------------------------
  245.        Defined As:    unsigned char ck_option;
  246.  
  247.        Description:   This variable is set to indicate how the user was
  248.                       logged off the system.  There are 5 macro's in the
  249.                       CKIT header file that describes each.
  250.  
  251.                         #define     EXITDOOR    0  Normal door exit
  252.                         #define     NOCARRIER   1  Dropped carrier*
  253.                         #define     TIMEOUT     2  Keyboard timeout*
  254.                         #define     SYSOP_O     3  Sysop request*
  255.                         #define     SYSTEMTIME  4  System time expired*
  256.                         #define     LOGOFF      5  User logged off
  257.  
  258.                        * These are normally handled internally by C-KIT
  259.  
  260.                                           COMPATIBILITY   Global Variables
  261.  
  262.        ck_silent               pcboard.sys door.sys wildcat! dorinfox.def
  263.        ------------------------------------------------------------------
  264.        Defined As:    short ck_silent;
  265.  
  266.        Description:   This variable when TRUE will prevent keyboard timeout
  267.                       beeps from being sent to the local console.
  268.                       It can be controlled via your program.
  269.  
  270.        ck_NO_FKEYS             pcboard.sys door.sys wildcat! dorinfox.def
  271.        ------------------------------------------------------------------
  272.        Defined As:    short ck_NO_FKEYS;
  273.  
  274.        Description:   This variable when TRUE will disable the local
  275.                       sysop keyboard F-keys and ALT keys except for
  276.                       ALT-H.  Default is FALSE. (F-keys enabled)
  277.  
  278.        ck_NOSYSTEM             pcboard.sys door.sys wildcat! dorinfox.def
  279.        ------------------------------------------------------------------
  280.        Defined As:    short ck_NOSYSTEM;
  281.  
  282.        Description:   This variable when TRUE will tell open_door()
  283.                       to not attempt a file open but to read it's
  284.                       information from a data structure.  Used for
  285.                       supporting BBS's not supported by C-kit.
  286.                       See open_door() for details.
  287.  
  288.        ck_NO_STATUS                 pcboard.sys door.sys wildcat!
  289.        ------------------------------------------------------------------
  290.        Defined As:    short  ck_NO_STATUS;
  291.  
  292.        Description:   When TRUE, tells CKIT not to create a status line.
  293.                       Must be set to desired state BEFORE open_door() is
  294.                       called.  Once open_door() is called, it cannot be
  295.                       changed.
  296.  
  297.        ck_logoff_color         pcboard.sys door.sys wildcat! dorinfox.def
  298.        ------------------------------------------------------------------
  299.        Defined As:    short ck_logoff_color;
  300.  
  301.        Description:   This variable used to specifiy the color of the
  302.                       exit_msg[] string. (See below).
  303.                       See the ckit.h file for colors available.
  304.  
  305.         Example:      ck_logoff_color = (green).
  306.  
  307.         NOTE:         If not specified, the default color is violet.
  308.  
  309.  
  310.        ck_exit_msg             pcboard.sys door.sys wildcat! dorinfox.def
  311.        ------------------------------------------------------------------
  312.        Defined As:    char  ck_exit_msg[40];
  313.  
  314.        Description:   THIS VARIABLE IS NO LONGER AVAILABLE IN CKIT2.0
  315.                       PLEASE SEE **ck_logoff_msgs.
  316.  
  317.        ck_logoff_msg           pcboard.sys door.sys wildcat! dorinfox.def
  318.        ------------------------------------------------------------------
  319.        Defined As:    char  ck_logoff_msg[40];
  320.  
  321.        Description:   THIS VARIABLE IS NO LONGER AVAILABLE IN CKIT2.0
  322.                       PLEASE SEE **ck_logoff_msgs.
  323.  
  324.                                           COMPATIBILITY   Global Variables
  325.  
  326.        ck_display                         pcboard.sys
  327.        ------------------------------------------------------------------
  328.        Defined As:    short ck_display;
  329.  
  330.        Description:   This variable is set to indicate the status of the
  331.                       local BBS display.
  332.                       file.  TRUE/FALSE   0 = No,  1 = yes.
  333.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  334.  
  335.        ck_printer                         pcboard.sys
  336.        ------------------------------------------------------------------
  337.        Defined As:    short ck_printer;
  338.  
  339.        Description:   This variable is set to indicate the status of the
  340.                       BBS printer.
  341.                       TRUE/FALSE   0 = No,  1 = yes.
  342.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  343.  
  344.        ck_pagebell                        pcboard.sys
  345.        ------------------------------------------------------------------
  346.        Defined As:    short ck_pagebell;
  347.  
  348.        Description:   This variable is set to indicate the status of the
  349.                       BBS pagebell.
  350.                       TRUE/FALSE   0 = No,  1 = yes.
  351.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  352.  
  353.        ck_callalarm                       pcboard.sys
  354.        ------------------------------------------------------------------
  355.        Defined As:    short ck_callalarm;
  356.  
  357.        Description:   This variable is set to indicate the status of the
  358.                       BBS  caller alarm.
  359.                       TRUE/FALSE   0 = No,  1 = yes.
  360.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  361.  
  362.        ck_PCB                   door.sys pcboard.sys wildcat! dorinfx.def
  363.        ------------------------------------------------------------------
  364.        Defined As:    short ck_PCB;
  365.  
  366.        Description:   This variable is set to indicate whether C-KIT found
  367.                       a PCBoard.sys file.
  368.                       TRUE/FALSE   0 = No,  1 = yes.
  369.  
  370.        ck_GAP                   door.sys pcboard.sys wildcat! dorinfx.def
  371.        ------------------------------------------------------------------
  372.        Defined As:    short ck_GAP;
  373.  
  374.        Description:   This variable is set to indicate whether C-KIT found
  375.                       a door.sys file.
  376.                       TRUE/FALSE   0 = No,  1 = yes.
  377.  
  378.        ck_PCB12                 door.sys pcboard.sys wildcat! dorinfx.def
  379.        ------------------------------------------------------------------
  380.        Defined As:    short ck_PCB12;
  381.  
  382.        Description:   This variable is set to indicate whether C-KIT found
  383.                       a PCBoard version 12.0 pcboard.sys file or not.
  384.                       TRUE/FALSE   0 = No,  1 = yes.
  385.  
  386.                                           COMPATIBILITY   Global Variables
  387.  
  388.        ck_WILDCAT               door.sys pcboard.sys wildcat! dorinfx.def
  389.        ------------------------------------------------------------------
  390.        Defined As:    short ck_WILDCAT;
  391.  
  392.        Description:   This variable is set to indicate whether C-KIT found
  393.                       a WILDCAT callinfo.bbs file or not.
  394.                       TRUE/FALSE   0 = No,  1 = yes.
  395.  
  396.        ck_RBBS                  door.sys pcboard.sys wildcat! dorinfx.def
  397.        ------------------------------------------------------------------
  398.        Defined As:    short ck_RBBS;
  399.  
  400.        Description:   This variable is set to indicate whether C-KIT found
  401.                       a RBBS type DORINFOx.DEF file or not.
  402.                       TRUE/FALSE   0 = No,  1 = yes.
  403.  
  404.        ck_GENERIC                                    any BBS system
  405.        ------------------------------------------------------------------
  406.        Defined As:    short ck_GENERIC;
  407.  
  408.        Description:   This variable is set to indicate whether C-KIT found
  409.                       a GENERIC.SYS file.
  410.                       TRUE/FALSE   0 = No,  1 = yes.
  411.  
  412.         If ck_GENERIC is TRUE you, the door author,  should stop and
  413.         ask the user for his/herfirst and last name.
  414.         C-kit no longer does this for you.
  415.           if(GENERIC) {
  416.             sprintf("\nPlease enter first and last name (MAX 25) ->");
  417.             get_cmdline_raw(45);
  418.             strncpy(ck_fullname, cmdline, 25);
  419.         }
  420.  
  421.        ck_FOSSIL                                     any BBS system
  422.        ------------------------------------------------------------------
  423.        Defined As:    short ck_FOSSIL;
  424.  
  425.        Description:   This variable is set to indicate whether a FOSSIL
  426.                       driver is in use.
  427.                       TRUE/FALSE   0 = No,  1 = yes.
  428.  
  429.         You can use this to test for conflicts with your door operations
  430.         that may not support a fossil driver.   For instance in shelling
  431.         out to Zmodem for a file xfer.
  432.  
  433.        ck_Digiboard                                  any BBS system
  434.        ------------------------------------------------------------------
  435.        Defined As:    short ck_Digiboard;
  436.  
  437.        Description:   This variable is set to indicate whether the
  438.                       Digiboard Intelligent Async driver is in use.
  439.                       TRUE/FALSE   0 = No,  1 = yes.
  440.  
  441.         You can use this to test for conflicts with your door operations
  442.         that may not support a Digiboard.    For instance in shelling
  443.         out to Zmodem for a file xfer which doesn't support the Digiboard.
  444.  
  445.                                           COMPATIBILITY   Global Variables
  446.  
  447.        ck_graphics             pcboard.sys door.sys wildcat! dorinfox.def
  448.        ------------------------------------------------------------------
  449.        Defined As:    short ck_graphics;
  450.  
  451.        Description:   This variable is set to indicate the status of the
  452.                       user graphics mode.
  453.                       Supports ANSI X3.64 standard commands.
  454.                       TRUE/FALSE   0 = No,  1 = yes.
  455.  
  456.        ck_non_ibm              pcboard.sys door.sys wildcat! dorinfox.def
  457.        ------------------------------------------------------------------
  458.        Defined As:    short ck_non_ibm;
  459.  
  460.        Description:   This variable is set to indicate whether the caller
  461.                       is using 7 bits instead of 8 bits.  Using 7 bits
  462.                       doesn't allow for IBM graphic characters above
  463.                       128 to be displayed correctly.
  464.                       TRUE/FALSE   0 = No,  1 = yes.
  465.  
  466.        ck_error_connection          pcboard.sys door.sys wildcat!
  467.        ------------------------------------------------------------------
  468.        Defined As:    short ck_error_connection;
  469.  
  470.        Description:   This variable is set to indicate the status of the
  471.                       modem error_connection.
  472.                       TRUE/FALSE   0 = No,  1 = yes.
  473.  
  474.  
  475.  
  476.                                           COMPATIBILITY   Global Variables
  477.  
  478.        ck_local                pcboard.sys door.sys wildcat! dorinfox.def
  479.        ------------------------------------------------------------------
  480.        Defined As:    short ck_local;
  481.  
  482.        Description:   This variable is set to indicate the status of the
  483.                       local/remote operation of door.
  484.                       TRUE/FALSE   0 = No,  1 = yes.
  485.  
  486.        ck_expert                          pcboard.sys door.sys
  487.        ------------------------------------------------------------------
  488.        Defined As:    short ck_expert;
  489.  
  490.        Description:   This variable is set to indicate the status of the
  491.                       expert/novice mode of user.
  492.                       TRUE/FALSE   0 = No,  1 = yes.
  493.  
  494.        ck_event_active                    pcboard.sys
  495.        ------------------------------------------------------------------
  496.        Defined As:    short ck_event_active;
  497.  
  498.        Description:   This variable is set to indicate the status of the
  499.                       system event.
  500.                       TRUE/FALSE   0 = No,  1 = yes.
  501.                       Useful with  14.x pcboard.sys usage only
  502.  
  503.        ck_event_slide                     pcboard.sys
  504.        ------------------------------------------------------------------
  505.        Defined As:    short ck_event_slide;
  506.  
  507.        Description:   This variable is set to indicate whether the system
  508.                       event can be moved or not.
  509.                       TRUE/FALSE   0 = No,  1 = yes.
  510.                       Useful with 14.x pcboard.sys useage only
  511.  
  512.        ck_sysop_next                      pcboard.sys
  513.        ------------------------------------------------------------------
  514.        Defined As:    char  ck_sysop_next[2];
  515.  
  516.        Description:   This C string indicates the status of the
  517.                       Sysop Next flag.  N = sysop next, X = exit to system,
  518.                       space = nothing pending.
  519.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  520.  
  521.        ck_netchat                         pcboard.sys
  522.        ------------------------------------------------------------------
  523.        Defined As:    char  ck_netchat[2];
  524.  
  525.        Description:   This C string indicates the status of the
  526.                       the user's netchat.  U = Unavailable,
  527.                       A = available.
  528.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  529.  
  530.        ck_mem_msg                         pcboard.sys 14.5
  531.        ------------------------------------------------------------------
  532.        Defined As:    long  ck_mem_msg;
  533.  
  534.        Description:   Memorized message pointer.  This is in it's raw
  535.                       form.  To use it, you will need to convert from
  536.                       QBasic single (MKS$) to IEEE long.   Conversion
  537.                       routines are available on the support BBS.
  538.  
  539.                                          COMPATIBILITY   Global Variables
  540.  
  541.        ck_aport                pcboard.sys door.sys wildcat! dorinfox.def
  542.        ------------------------------------------------------------------
  543.        Defined As:    char  ck_aport[2];
  544.  
  545.        Description:   This C string is an ASCII string of the com
  546.                       port in use as determined. (if using a Digiboard
  547.                       it will indicate the port found in the system file)
  548.                       See also ck_port.
  549.  
  550.        ck_bps_open                  pcboard.sys door.sys wildcat!
  551.        ------------------------------------------------------------------
  552.        Defined As:    char  ck_bps_open[6];
  553.  
  554.        Description:   This C string is an ASCII string of the
  555.                       BBS's DTE to modem baud rate.
  556.                       Not available with PCBoard 12.0
  557.  
  558.        ck_baud_rate            pcboard.sys door.sys wildcat! dorinfox.def
  559.        ------------------------------------------------------------------
  560.        Defined As:    char  ck_baud_rate[6];
  561.  
  562.        Description:   This C string is an ASCII string of the
  563.                       callers baud rate. (DCE rate)
  564.  
  565.        ck_uart_base            pcboard.sys door.sys wildcat! dorinfox.def
  566.        ------------------------------------------------------------------
  567.        Defined As:    short ck_uart_base;
  568.  
  569.        Description:   This contains the UART's base address that C-KIT is
  570.                       currently using either as the default or passed
  571.                       by the PORT command.
  572.  
  573.        ck_irq                  pcboard.sys door.sys wildcat! dorinfox.def
  574.        ------------------------------------------------------------------
  575.        Defined As:    short ck_irq;
  576.  
  577.        Description:   This contains the IRQ that C-KIT is
  578.                       currently using either as the default or
  579.                       passed by the PORT command.
  580.  
  581.        ck_firstname            pcboard.sys door.sys wildcat! dorinfox.def
  582.        ------------------------------------------------------------------
  583.        Defined As:    char  ck_firstname[16];
  584.  
  585.        Description:   This C string is an ASCII string of the
  586.                       caller first name.
  587.  
  588.        ck_password                  pcboard.sys door.sys wildcat!
  589.        ------------------------------------------------------------------
  590.        Defined As:    char  ck_password[13];
  591.  
  592.        Description:   This C string is an ASCII string of the
  593.                       caller password.
  594.  
  595.        ck_fullname             pcboard.sys door.sys wildcat! dorinfox.def
  596.        ------------------------------------------------------------------
  597.        defined As:    char  ck_fullname[26];
  598.  
  599.        Description:   This C string is an ASCII string of the
  600.                       caller fullname.
  601.  
  602.                                           COMPATIBILITY   Global Variables
  603.  
  604.        ck_page_length          pcboard.sys door.sys wildcat! dorinfox.def
  605.        ------------------------------------------------------------------
  606.        Defined As:    BYTE  ck_page_length;
  607.  
  608.        Description:   Page length of user.  This information is not
  609.                       available with PCBoard 12.0 so there is a default
  610.                       of 23.  The door author can adjust as desired.
  611.                       This is also used by display_file().  Setting to
  612.                       0 equals continous. (NON-STOP).
  613.  
  614.        ck_language                        pcboard.sys
  615.        ------------------------------------------------------------------
  616.        defined As:    char  ck_language[5];
  617.  
  618.        Description:   This C string is an ASCII string of the
  619.                       caller language.
  620.                       Space = English
  621.  
  622.  
  623.        ck_time_logged               pcboard.sys door.sys wildcat!
  624.        ------------------------------------------------------------------
  625.        defined As:    char  ck_time_logged[6];
  626.  
  627.        Description:   This C string is an ASCII string of the time
  628.                       caller logged onto the BBS.
  629.  
  630.        ck_event_time                      pcboard.sys door.sys
  631.        ------------------------------------------------------------------
  632.        defined As:    char  ck_event_time[6];
  633.  
  634.        Description:   This C string is an ASCII string of the
  635.                       system event time of the BBS as HH:MM.
  636.                       Not available with PCBoard 12.0
  637.  
  638.        ck_time_on                         pcboard.sys
  639.        ------------------------------------------------------------------
  640.        Defined As:    short ck_time_on;
  641.  
  642.        Description:   This variable indicates the time in minutes
  643.                       past midnight the user logged on.
  644.  
  645.        ck_prev_used                       pcboard.sys
  646.        ------------------------------------------------------------------
  647.        Defined As:    short ck_prev_used;      NOTE: N/A for PCBoard 12.0
  648.  
  649.        Description:   This variable indicates the time in minutes
  650.                       used in previous calls today.
  651.  
  652.        ck_user_record               pcboard.sys door.sys wildcat!
  653.        ------------------------------------------------------------------
  654.        Defined As:    unsigned ck_short user_record;
  655.  
  656.        Description:   This variable holds the user record number.
  657.  
  658.        ck_dload_limit                     pcboard.sys
  659.        ------------------------------------------------------------------
  660.        Defined As:    short     ck_dload_limit;
  661.  
  662.        Description:   This variable holds the user's allowed dload Kbytes
  663.                       on the system.
  664.  
  665.                                           COMPATIBILITY   Global Variables
  666.  
  667.        ck_time_limit                      pcboard.sys
  668.        ------------------------------------------------------------------
  669.        Defined As:    short     ck_time_limit;
  670.  
  671.        Description:   This variable holds the user BBS system time limit
  672.                       in minutes.
  673.  
  674.        ck_time_credit                     pcboard.sys
  675.        ------------------------------------------------------------------
  676.        Defined As:    short     ck_time_credit;
  677.  
  678.        Description:   This variable holds the time the user has been given
  679.                       (pos or neg.) that will be added to pcboard.sys when
  680.                       returned to the bulletin board.
  681.  
  682.        ck_time_credit_old                 pcboard.sys
  683.        ------------------------------------------------------------------
  684.        Defined As:    short     ck_time_credit_old;
  685.  
  686.        Description:   This variable holds the time credit in minutes
  687.                       (pos or neg.) that was originally found in the
  688.                       pcboard.sys when the door was opened.  This will
  689.                       be added with the time_credit when the door is
  690.                       closed.
  691.  
  692.        ck_time_added                    pcboard.sys
  693.        ------------------------------------------------------------------
  694.        Defined As:    short     ck_time_added;
  695.  
  696.        Description:   This variable holds the area user time added so
  697.                       far in minutes.
  698.  
  699.        ck_min_left             pcboard.sys door.sys wildcat! dorinfox.def
  700.        ------------------------------------------------------------------
  701.        Defined As:    short     ck_min_left;
  702.  
  703.        Description:   This variable holds the user time left on system
  704.                       at the time the door was opened. (static).
  705.                       If you want the time remaining in the door, you
  706.                       would need to call the mins_left_system() procedure.
  707.  
  708.        ck_min_remaining                                          door.sys
  709.        ------------------------------------------------------------------
  710.        Defined As:    char      ck_min_remaining[6];
  711.  
  712.        Description:   This is the same thing as min_left.  It is
  713.                       available as a string only if door.sys is used.
  714.                       See min_left above. (static)
  715.  
  716.        ck_sec_remaining                                          door.sys
  717.        ------------------------------------------------------------------
  718.        Defined As:    char      ck_sec_remaining[6];
  719.  
  720.        Description:   This variable holds the seconds left on system
  721.                       at the time the door was opened. (static).
  722.                       If you want the time remaining in the door, you
  723.                       would need to call the mins_left_system() procedure.
  724.  
  725.                                           COMPATIBILITY   Global Variables
  726.  
  727.        ck_port                      pcboard.sys door.sys wildcat!
  728.        ------------------------------------------------------------------
  729.        Defined As:    short     ck_port;
  730.  
  731.        Description:   This variable holds the com port in use.
  732.                       Equal to 0 if local mode.  If using a Digiboard
  733.                       it will indicate the Digiboard channel in use.
  734.  
  735.        ck_node[]               pcboard.sys door.sys wildcat! dorinfox.def
  736.        ------------------------------------------------------------------
  737.        Defined As:    char      ck_node[6];    NOTE: N/A for PCBoard 12.0
  738.  
  739.        Description:   This string holds the node in use.
  740.                       Equal to space if no network active.
  741.                       Also compatable with PCBoard /X versions.
  742.  
  743.  
  744.        *ck_conferences                  door.sys        wildcat!
  745.        ------------------------------------------------------------------
  746.        Defined As:    char *ck_conferences;
  747.  
  748.        Description:   This a pointer to a string of conferences/forums
  749.                       the user is registered in.
  750.  
  751.        ck_parity                        door.sys wildcat!
  752.        ------------------------------------------------------------------
  753.        Defined As:    short ck_parity;
  754.  
  755.        Description:   Represent the ASCII character of parity in use.
  756.                       Note this NOT a string. It will either be ASCII
  757.                       7 (0x37) or 8 (0x38).
  758.  
  759.        ck_protocol                  pcboard.sys door.sys wildcat!
  760.        ------------------------------------------------------------------
  761.        Defined As:    char ck_protocol[15]
  762.  
  763.        Description:   String containing the users current protocol setting.
  764.                       PCBoard/GAP/SPITFIRE will only list the 1st char. of the
  765.                       protocol, WILDCAT! will give the entire protocol
  766.                       name.
  767.  
  768.        ck_security_level                   door.sys wildcat! dorinfox.def
  769.        ------------------------------------------------------------------
  770.        Defined As:    char ck_security_level[5]
  771.  
  772.        Description:   String containing the users security level.
  773.                       See also ck_user.sec below
  774.  
  775.        ck_current_conf                  door.sys
  776.        ------------------------------------------------------------------
  777.        Defined As:    short ck_current_conf;
  778.  
  779.        Description:   Conference number user just exited from to door.
  780.  
  781.        ck_caller_bday                   door.sys wildcat!
  782.        ------------------------------------------------------------------
  783.        Defined As:    char ck_caller_bday[8];
  784.  
  785.        Description:   String containing the callers birthday.
  786.                       as MM/DD/YY.  Not available with PCBoard systems.
  787.  
  788.                                           COMPATIBILITY   Global Variables
  789.  
  790.        ck_main_dir                      door.sys
  791.        ------------------------------------------------------------------
  792.        Defined As:    char ck_main_dir[80];
  793.  
  794.        Description:   String containing the path to the MAIN directory
  795.                       wherever the users file is located.
  796.  
  797.        ck_gen_dir                       door.sys
  798.        ------------------------------------------------------------------
  799.        Defined As:    char ck_gen_dir[80];
  800.  
  801.        Description:   String containing the path to the GEN directory.
  802.  
  803.  
  804.        ck_sysop_name                    door.sys dorinfox.def
  805.        ------------------------------------------------------------------
  806.        Defined As:    char ck_sysop_name[15];
  807.  
  808.        Description:   String containing the sysop's first name.
  809.  
  810.        ck_sysop_alias                   door.sys
  811.        ------------------------------------------------------------------
  812.        Defined As:    char ck_sysop_alias[15];
  813.  
  814.        Description:   String containing the sysop's alias name.
  815.  
  816.        ck_ansi_ng                       door.sys
  817.        ------------------------------------------------------------------
  818.        Defined As:    short ck_ansi_ng;
  819.  
  820.        Description:   ANSI supported and caller using NG mode.
  821.                       TRUE/FALSE   0 = No,  1 = yes.
  822.  
  823.        ck_record_lock                   door.sys
  824.        ------------------------------------------------------------------
  825.        Defined As:    short ck_record_lock;
  826.  
  827.        Description:   User record locking.
  828.                       TRUE/FALSE   0 = No,  1 = yes.
  829.  
  830.        ck_default_color                 door.sys
  831.        ------------------------------------------------------------------
  832.        Defined As:    char ck_default_color[2];
  833.  
  834.        Description:   String containing system's default color
  835.  
  836.        ck_last_called                   door.sys
  837.        ------------------------------------------------------------------
  838.        Defined As:    char ck_last_called[6];
  839.  
  840.        Description:   String containing user last time called.
  841.                       HH:MM.
  842.  
  843.        ck_last_file_scan                door.sys wildcat!
  844.        ------------------------------------------------------------------
  845.        Defined As:    char ck_last_file_scan[9];
  846.  
  847.        Description:   String containing user last new files scan as
  848.                       MM/DD/YY.
  849.  
  850.                                           COMPATIBILITY   Global Variables
  851.  
  852.        ck_daily_files                   door.sys wildcat!
  853.        ------------------------------------------------------------------
  854.        Defined As:    char ck_daily_files[4];
  855.  
  856.        Description:   String containing number of files user has download
  857.                       so far today.
  858.  
  859.        ck_daily_bytes                   door.sys wildcat!
  860.        ------------------------------------------------------------------
  861.        Defined As:    char ck_daily_bytes[4];
  862.  
  863.        Description:   String containing number of K bytes user downloaded
  864.                       so far today.
  865.  
  866.        ck_total_doors                   door.sys
  867.        ------------------------------------------------------------------
  868.        Defined As:    char ck_total_doors[4];
  869.  
  870.        Description:   String containing number of doors user has opened.
  871.  
  872.        ck_msgs_left                     door.sys
  873.        ------------------------------------------------------------------
  874.        Defined As:    char ck_msgs_left[4];
  875.  
  876.        Description:   String containing total number of messages left by
  877.                       user.
  878.  
  879.        ck_max_files                       door.sys
  880.        ------------------------------------------------------------------
  881.        Defined As:    char ck_max_files[4];
  882.  
  883.        Description:   String containing Max. number of files allowed.
  884.  
  885.        ck_upload_Kbytes                   door.sys
  886.        ------------------------------------------------------------------
  887.        Defined As:    char ck_upload_Kbyte[10];
  888.  
  889.        Description:   String containing total "K" bytes uploaded.
  890.  
  891.        ck_download_Kbytes                   door.sys wildcat!
  892.        ------------------------------------------------------------------
  893.        Defined As:    char ck_download_Kbyte[10];
  894.  
  895.        Description:   String containing total "K" bytes downloaded.
  896.  
  897.        ck_dload_total                        door.sys wildcat!
  898.        ------------------------------------------------------------------
  899.        Defined As:    char ck_dload_total[5];
  900.  
  901.        Description:   String containing total files downloaded.
  902.  
  903.        ck_upload_total                      door.sys wildcat!
  904.        ------------------------------------------------------------------
  905.        Defined As:    char ck_upload_total[5];
  906.  
  907.        Description:   String containing total files uploaded.
  908.  
  909.                                           COMPATIBILITY   Global Variables
  910.  
  911.        ck_monitor_type                               wildcat!
  912.        ------------------------------------------------------------------
  913.        Defined As:    char ck_monitor_type[5];
  914.  
  915.        Description:   String containing monitor type MONO/COLOR
  916.                       NOTE: C-KIT will set graphics true/false
  917.                       depending on this setting. see Graphics above.
  918.  
  919.        ck_max_sec                                    wildcat!
  920.        ------------------------------------------------------------------
  921.        Defined As:    char ck_max_sec[5];
  922.  
  923.        Description:   String containing a systems maximum user
  924.                       security level for WILDCAT! systems.
  925.  
  926.  
  927.        ck_high_msg                                   wildcat!
  928.        ------------------------------------------------------------------
  929.        Defined As:    char ck_high_msg[10]
  930.  
  931.        Description:   String containing the users highest message
  932.                       read.
  933.  
  934.        ck_name_in_use                                wildcat!
  935.        ------------------------------------------------------------------
  936.        Defined As:    BYTE ck_name_in_use
  937.  
  938.        Description:   Set to TRUE/FALSE. This is called already_connected
  939.                        in the WILDCAT def. file.
  940.        ck_door_opened                                wildcat!
  941.        ------------------------------------------------------------------
  942.        Defined As:    short ck_door_opened
  943.  
  944.        Description:   Which door was opened to run your door.
  945.  
  946.        ck_BBSname                                    dorinfox.def
  947.        ------------------------------------------------------------------
  948.        Defined As:    char ck_BBSname[63];
  949.  
  950.        Description:   Name of the BBS system running the door.
  951.  
  952.  
  953.        ck_pcbsysbuf                     pcboard.sys  PCBxx.x
  954.        ------------------------------------------------------------------
  955.        Defined As:    BYTE    *ck_pcbsysbuf;
  956.  
  957.        Description:   This is a pointer to the buffer holding the
  958.                       pcboard.sys file read.  This buffer will be
  959.                       written back to pcboard.sys when close_door()
  960.                       is called.  It is provided so a door author
  961.                       can manipulate any byte in the pcboard.sys
  962.                       file and will in turn be written back to the
  963.                       pcboard.sys file.
  964.  
  965.        ck_last_event_date                            PCB14.5A
  966.        ------------------------------------------------------------------
  967.        Defined As:    char ck_last_event_date[9]
  968.  
  969.        Description:   String containing Last Event Date
  970.                       (in "MM-DD-YY" format).
  971.  
  972.  
  973.        ck_last_event_mins                            PCB14.5A
  974.        ------------------------------------------------------------------
  975.        Defined As:    short ck_last_event_mins
  976.  
  977.        Description:   Last Event Minute (in minutes since midnight)
  978.  
  979.  
  980.        ck_exited_DOS                                 PCB14.5A
  981.        ------------------------------------------------------------------
  982.        Defined As:    BYTE ck_exited_DOS
  983.  
  984.        Description:   Set to TRUE/FALSE.
  985.                       Caller Exited to DOS (TRUE = Yes, FALSE = No)
  986.  
  987.        ck_event_coming_up                            PCB14.5A
  988.        ------------------------------------------------------------------
  989.        Defined As:    BYTE ck_event_coming_up
  990.  
  991.        Description:   Set to TRUE/FALSE.
  992.                       Event Up Coming (TRUE = Yes, FALSE = No)
  993.  
  994.        ck_disable_uploads                            PCB14.5A
  995.        ------------------------------------------------------------------
  996.        Defined As:    BYTE ck_disable_uploads
  997.  
  998.        Description:   Set to TRUE/FALSE.
  999.                       Stop Uploads (TRUE = Yes, FALSE = No)
  1000.  
  1001.        ck_last_conf                                  PCB14.5A
  1002.        ------------------------------------------------------------------
  1003.        Defined As:    short ck_last_conf
  1004.  
  1005.        Description:   Conference Area user was in (up to 65535)
  1006.  
  1007.  
  1008.                                                           Global Variables
  1009.  
  1010.        These are part of the structure "ck_user" as defined in the CKIT.H file.
  1011.        All these user structure members are available only if the door author
  1012.        specifies USERFILES True (see above) and the system is PCBoard version
  1013.        14.x.  Some but not all members are available if the author specifies
  1014.        USERFILE True and used with Pcboard version 12.0.  If the door author
  1015.        does not specify USERFILE's file TRUE, then do not use this structure.
  1016.  
  1017.        If you plan on using this structure and/or update_user(), you
  1018.        must using WORD alignment when compiling your door program for
  1019.        CKIT < version 2.0.  For CKIT versions 2.0 and greater, you must
  1020.        use BYTE alignment.
  1021.  
  1022.        ck_user.name   See also fullname
  1023.        ------------------------------------------------------------------
  1024.        Defined As:    char    ck_user.name[26];
  1025.  
  1026.        Description:   This C string is an ASCII string of the
  1027.                       caller's fullname.
  1028.  
  1029.        ck_user.city
  1030.        ------------------------------------------------------------------
  1031.        Defined As:    char    ck_user.city[25];
  1032.  
  1033.        Description:   This C string is an ASCII string of the
  1034.                       caller's city, state.
  1035.  
  1036.        ck_user.pwrd
  1037.        ------------------------------------------------------------------
  1038.        Defined As:    char    ck_user.pwrd[13];
  1039.  
  1040.        Description:   This C string is an ASCII string of the
  1041.                       caller's password.
  1042.  
  1043.        ck_user.bphone
  1044.        ------------------------------------------------------------------
  1045.        Defined As:    char    ck_user.bphone[14];
  1046.  
  1047.        Description:   This C string is an ASCII string of the caller's
  1048.                       business phone number.
  1049.  
  1050.        ck_user.phone
  1051.        ------------------------------------------------------------------
  1052.        Defined As:    char    ck_user.phone[14];
  1053.  
  1054.        Description:   This C string is an ASCII string of the caller's
  1055.                       home phone number.
  1056.  
  1057.        ck_user.last_date
  1058.        ------------------------------------------------------------------
  1059.        Defined As:    char    ck_user.last_date[7];
  1060.  
  1061.        Description:   This C string is an ASCII string of the caller's
  1062.                       last date on system.
  1063.                       Format is YYMMDD
  1064.  
  1065.  
  1066.                                                           Global Variables
  1067.  
  1068.         These are part of the structure "ck_user" as defined in the
  1069.         CKIT.H file.  Information available from user file.
  1070.  
  1071.        ck_user.last_time
  1072.        ------------------------------------------------------------------
  1073.        Defined As:    char    ck_user.last_time[6];
  1074.        Description:   This C string is an ASCII string of the caller's
  1075.                       last time on system.
  1076.                       Format is HH:MM
  1077.  
  1078.        ck_user.expert     See also expert above
  1079.        ------------------------------------------------------------------
  1080.        Defined As:    char    user.expert[2];
  1081.  
  1082.        Description:   This C string is an ASCII string of the caller
  1083.                       expert mode ( Y or N )
  1084.  
  1085.        ck_user.protocol
  1086.        ------------------------------------------------------------------
  1087.        Defined As:    char    ck_user.protocol[2];
  1088.  
  1089.        Description:   This C string is an ASCII string of the caller
  1090.                       protocol type in effect.
  1091.  
  1092.        ck_user.packed_byte
  1093.        ------------------------------------------------------------------
  1094.        Defined As:    BYTE    ck_user.packed_byte;
  1095.  
  1096.        Description:   This holds the PCBoard packed byte to indicate
  1097.                       various user options in the user file.
  1098.  
  1099.        ck_user.filedate                         see also _last_file_scan
  1100.        ------------------------------------------------------------------
  1101.        Defined As:    char    ck_user.filedate[7];
  1102.  
  1103.        Description:   This C string is an ASCII string of the caller
  1104.                       last DIR scan. in YYMMDD format
  1105.  
  1106.        ck_user.security
  1107.        ------------------------------------------------------------------
  1108.        Defined As:    BYTE   ck_user.security;
  1109.  
  1110.        Description:   This variable holds the user security level as
  1111.                       determined from USER file.
  1112.  
  1113.        ck_user.total_calls
  1114.        ------------------------------------------------------------------
  1115.        Defined As:    short     ck_user.total_calls;
  1116.  
  1117.        Description:   This variable holds the user total calls on system.
  1118.  
  1119.        ck_user.page_length        see also page_length
  1120.        ------------------------------------------------------------------
  1121.        Defined As:    BYTE      ck_user.page_length;
  1122.  
  1123.        Description:   This variable holds the user page setting.
  1124.  
  1125.        ck_user.uploads             see also upload_total
  1126.        ------------------------------------------------------------------
  1127.        Defined As:    short     ck_user.uploads;
  1128.        Description:   This variable holds the user total uploads.
  1129.  
  1130.                                                           Global Variables
  1131.  
  1132.         These are part of the structure "ck_user" as defined in the
  1133.         CKIT.H file.  Information available from user file.
  1134.  
  1135.        ck_user.downloads           see also dload_total
  1136.        ------------------------------------------------------------------
  1137.        Defined As:    short     ck_user.downloads;
  1138.  
  1139.        Description:   This variable holds the user total downloads.
  1140.  
  1141.        ck_user.dload_bytes          see also dload_total
  1142.        ------------------------------------------------------------------
  1143.        Defined As:    double    ck_user.dload_bytes;
  1144.  
  1145.        Description:   This variable holds the user total DAILY
  1146.                       downloaded bytes determined from USER file.
  1147.                       This variable is in it's raw Qbasic MKD$.
  1148.                       To be of use to C, it needs to be converted
  1149.                       from QBASIC real to C's IEEE float.
  1150.                       The conversion routines/examples are available from
  1151.                       the support BBS. Before changing this variable
  1152.                       it should also be converted back to a QBASIC real.
  1153.  
  1154.        ck_user.comment1
  1155.        ------------------------------------------------------------------
  1156.        Defined As:    char    ck_user.comment1[31];
  1157.  
  1158.        Description:   This C string is an ASCII string of the caller
  1159.                       user maintained comment.
  1160.  
  1161.        ck_user.comment2
  1162.        ------------------------------------------------------------------
  1163.        Defined As:    char    ck_user.comment2[32];
  1164.  
  1165.        Description:   This C string is an ASCII string of the caller
  1166.                       sysop maintained comment.
  1167.  
  1168.        ck_user.time_used
  1169.        ------------------------------------------------------------------
  1170.        Defined As:    short   ck_user.time_used;
  1171.  
  1172.        Description:   Elapsed time on system. (minutes)
  1173.  
  1174.        ck_user.expire_date
  1175.        ------------------------------------------------------------------
  1176.        Defined As:    char    ck_user.expire_date[7];
  1177.  
  1178.        Description:   This C string is an ASCII string of the caller
  1179.                       expiration date in YYMMDD format.
  1180.  
  1181.        ck_user.expire_level
  1182.        ------------------------------------------------------------------
  1183.        Defined As:    BYTE    ck_user.expire_level;
  1184.  
  1185.        Description:   This is the users expired security level read
  1186.                       from pcboard users file.
  1187.  
  1188.                                                           Global Variables
  1189.  
  1190.         These are part of the structure "ck_user" as defined in the
  1191.         CKIT.H file.  Information available from user file.
  1192.  
  1193.        ck_user.current_conf
  1194.        ------------------------------------------------------------------
  1195.        Defined As:    BYTE    ck_user.current_conf;
  1196.  
  1197.        Description:   This is the last conference user was in read
  1198.                       from pcboard users file.
  1199.  
  1200.        ck_user.conferences
  1201.        ------------------------------------------------------------------
  1202.        Defined As:    BYTE    ck_user.conferences[6]
  1203.  
  1204.        Description:   This is 5 bytes containing the Bitmaps of the
  1205.                       conferences the user is registered in.
  1206.                       They are in their "raw" form and will have to
  1207.                       be decoded before used and encoded before
  1208.                       storing.  Routines are available from the
  1209.                       support BBS.
  1210.  
  1211.        ck_user.expire_conf
  1212.        ------------------------------------------------------------------
  1213.        Defined As:    BYTE    ck_user.expire_conf[6]
  1214.  
  1215.        Description:   This is 5 bytes containing the Bitmaps of the
  1216.                       conferences the user is registered in after
  1217.                       his/her expiration date.
  1218.                       They are in their "raw" form and will have to
  1219.                       be decoded before used and encoded before
  1220.                       storing.  Routines are available from the
  1221.                       support BBS.
  1222.  
  1223.        ck_user.scan_conf
  1224.        ------------------------------------------------------------------
  1225.        Defined As:    BYTE    ck_user.scan_conf[6]
  1226.  
  1227.        Description:   This is 5 bytes containing the Bitmaps of the
  1228.                       conferences the user is registered in and
  1229.                       desires a mail scan.
  1230.                       They are in their "raw" form and will have to
  1231.                       be decoded before used and encoded before
  1232.                       storing.  Routines are available from the
  1233.                       support BBS.
  1234.  
  1235.        ck_user.dload_total          see also dload_total
  1236.        ------------------------------------------------------------------
  1237.        Defined As:    double    ck_user.dload_total
  1238.  
  1239.        Description:   This variable holds the user total downloaded
  1240.                       bytes determined from USER file.  This variable
  1241.                       is in it's raw Qbasic MKD$.  To be of use to
  1242.                       C, it needs to be converted from QBASIC real
  1243.                       to C's IEEE float.  The conversion/example routines
  1244.                       are available from the support BBS. Before changing
  1245.                       this variable it should also be converted back to a
  1246.                       QBASIC real.
  1247.  
  1248.                                                           Global Variables
  1249.  
  1250.         These are part of the structure "ck_user" as defined in the
  1251.         CKIT.H file.  Information available from user file.
  1252.  
  1253.        ck_user.upload_total         see also dload_total
  1254.        ------------------------------------------------------------------
  1255.        Defined As:    double    ck_user.upload_total;
  1256.  
  1257.        Description:   This variable holds the user total uploaded
  1258.                       bytes determined from USER file.  This variable
  1259.                       is in it's raw Qbasic MKD$.  To be of use to
  1260.                       C, it needs to be converted from QBASIC real
  1261.                       to C's IEEE float.  The conversion/example routines
  1262.                       are available from the support BBS. Before changing
  1263.                       this variable it should also be converted back to a
  1264.                       QBASIC real.
  1265.  
  1266.        ck_user.delete_user
  1267.        ------------------------------------------------------------------
  1268.        Defined As:    char    ck_user.delete_user[2];
  1269.  
  1270.        Description:   This C string is an ASCII string of delete
  1271.                       user flag. (Y or N)
  1272.  
  1273.  
  1274.        ck_user.last_msg_read        see also dload_total
  1275.        ------------------------------------------------------------------
  1276.        Defined As:    long   ck_user.last_msg_read;
  1277.  
  1278.        Description:   This variable holds the user last message read
  1279.                       in the main conference.  This variable
  1280.                       is in it's raw Qbasic MKS$.  To be of use to
  1281.                       C, it needs to be converted from QBASIC real
  1282.                       to C's IEEE float.  The conversion/example routines
  1283.                       are available from the support BBS. Before changing
  1284.                       this variable it should also be converted back to a
  1285.                       QBASIC real.
  1286.  
  1287.        ck_user.last_read            see also dload_total
  1288.        ------------------------------------------------------------------
  1289.        Defined As:    long      ck_user.last_read[39]
  1290.  
  1291.        Description:   This variable array contains the  last
  1292.                       read message pointers for conferences 0-39.
  1293.                       They are in raw Qbasic MKS$.  To be of use to
  1294.                       C, it needs to be converted from QBASIC real
  1295.                       to C's IEEE float.  The conversion/example routines
  1296.                       are available from the support BBS. Before changing
  1297.                       this variable it should also be converted back to a
  1298.                       QBASIC real.
  1299.  
  1300.                                                  System  Global Variables
  1301.  
  1302.         These variables are available with any BBS system.  Some are used
  1303.         for customization of your door program and MUST be defined.
  1304.         Others using are meant to be read only variables available globally.
  1305.         Some are are used in conjuction with high level functions as noted.
  1306.  
  1307.        char     progname[]         pcboard.sys door.sys wildcat! generic
  1308.        ------------------------------------------------------------------
  1309.        Defined as:    char   progname[21];
  1310.  
  1311.        Description:   Set this to your Door program name.  It will be
  1312.                       display on the status line on the sysop screen.
  1313.                       MAXIMUM length is 20 characters! Do not exceed this!
  1314.  
  1315.        NOTE: THIS IS NOT AN OPTION. You must define progname[] even if
  1316.              you do not plan on using it.
  1317.  
  1318.        ck_cmdline[]                 pcboard.sys door.sys wildcat! generic
  1319.        ------------------------------------------------------------------
  1320.        Defined as:    BYTE    ck_cmdline[128]
  1321.  
  1322.        Description:   This is used by get_cmdline(), to read the user
  1323.                       keyboard input to.
  1324.                       Please see the CKITDEMO.C for usage.
  1325.  
  1326.        See Also:      ck_get_cmdline();
  1327.  
  1328.        ck_par[]                     pcboard.sys door.sys wildcat! generic
  1329.        ------------------------------------------------------------------
  1330.        Defined as:    char    ck_par[128];
  1331.  
  1332.        Description:   This is used by get_nextpar(), to parse stacked
  1333.                       commands to.
  1334.                       Please see CKITDEMO.C for usage.
  1335.  
  1336.        See Also:      ck_get_cmdline(), ck_get_nextpar();
  1337.  
  1338.        ck_scan_code                 pcboard.sys door.sys wildcat! generic
  1339.        ------------------------------------------------------------------
  1340.        Defined as:    size_t  ck_scan_code;
  1341.  
  1342.        Description:   This variable will if NONZERO  contain the key_code
  1343.                       of any NON-STANDARD keys on the IBM keyboard.
  1344.                       (F1-F10, PgDn, PgUp etc).  The remote user must be
  1345.                       in some type of terminal program that will allow
  1346.                       passing the keycodes.  Qmodem in "DOORWAY" mode
  1347.                       is one example.
  1348.                       Please see ck_input(), ck_get_cmdline() and
  1349.                       ckitdemo.c for examples.
  1350.  
  1351.        See Also:      ck_get_cmdline();
  1352.  
  1353.         ck_key_source               pcboard.sys door.sys wildcat! generic
  1354.        ------------------------------------------------------------------
  1355.        Defined as:    short   ck_key_source;
  1356.  
  1357.        Description:   This variable will a 1 if the input from get_cmdline()
  1358.                       came from the LOCAL console or a 2 if it came from
  1359.                       a REMOTE console.
  1360.  
  1361.        See Also:      ck_get_cmdline(), ck_input()
  1362.  
  1363.                                                  System  Global Variables
  1364.  
  1365.         ck_linenum                  pcboard.sys door.sys wildcat! generic
  1366.        ------------------------------------------------------------------
  1367.        Defined as:    short   ck_linenum;
  1368.  
  1369.        Description:   This variable be will incremented each time a call
  1370.                       to newline() is made.
  1371.  
  1372.  
  1373.        See Also:      ck_page_length, ck_newline()
  1374.  
  1375.  
  1376.        ck_logoff_msgs               pcboard.sys door.sys wildcat! generic
  1377.        ------------------------------------------------------------------
  1378.        Defined as:    char    **ck_logoff_msgs;
  1379.  
  1380.     Description:
  1381.     This is pointer to an array of pointers that will be printed at the
  1382.     time the door is closed.  The array of pointers has a length of 6
  1383.     elements. Which message is printed depends on the value of ck_option.
  1384.     The code looks for an array of pointers to the exit messages and uses
  1385.     the ck_option variable to pick which one to print.    This pointer to
  1386.     the array of pointers allows you to define your own array of pointers
  1387.     to the 6 exit messages.  This allows the messages to be of any length
  1388.     and which message printed will be based on the value of ck_option (0-5)
  1389.     respectfully.  See also the variable ck_option.
  1390.     They must be in this order.
  1391.  
  1392.     Example to create your own log off messages of ANY size.
  1393.     In your source code:
  1394.  
  1395.         char    option0[] = "New Returning to system msg, any size\n";
  1396.         char    option1[] = "New CARRIER DROPPED! msg, any size\n";
  1397.         char    option2[] = "New Keyboard Timeout! msg, any size\n";
  1398.         char    option3[] = "New Sysop requests return to BBS msg, any size\n";
  1399.         char    option4[] = "New System time has expired! msg, any size\n";
  1400.         char    option5[] = "New Thanks for calling! msg, any size";
  1401.  
  1402.         static  char    *logoffs[6] = {         /* create array of ptrs */
  1403.                 option0,
  1404.                 option1,
  1405.                 option2,
  1406.                 option3,
  1407.                 option4,
  1408.                 option5,
  1409.         };
  1410.  
  1411.     ck_logoff_msgs = &logoffs[0]; /* Set C-KIT's pointer to custom messages*/
  1412.  
  1413.                                                  System  Global Variables
  1414.  
  1415.        ck_logoff_msgs  <cont.>
  1416.        ------------------------------------------------------------------
  1417.  
  1418.       You do NOT have to define your own log off messages.  C-KIT has
  1419.     it's own internal defaults.  If you want to change just one individual
  1420.     log off message and leave the rest alone, then you can use the pointer
  1421.     that is initially contained in **ck_logoff_msgs and index to the one
  1422.     you want to change.  Doing this will limit the size to the max.
  1423.     indicated for that message.  The limits on changing individual logoff
  1424.     internal library messages are:
  1425.  
  1426.         MAX SIZE!
  1427.         ========
  1428.         option0[40] /* internal "returning to board" msg  */
  1429.         option1[16] /* internal "NO CARRIER!!"       msg  */
  1430.         option2[40] /* internal "keyboard timeout"   msg  */
  1431.         option3[48] /* internal "sysop request"      msg  */
  1432.         option4[36] /* internal "time expired"       msg  */
  1433.         option5[40] /* internal "goodbye"            msg  */
  1434.  
  1435.  
  1436.     To change only one internal logoff library message, use the pointer
  1437.     that is originally contained in **ck_logoff_msgs.  Indexing from it,
  1438.     you can use strcpy() to change it.  EXAMPLE:
  1439.  
  1440.     To change only the "returning to board" msg.
  1441.  
  1442. IN YOUR source code:
  1443. char exit_msg[40] = "Returning to system\n";  /* Max 40 allocated in lib */
  1444. strcpy(*(ck_logoff_msgs), exit_msg);   /* Using the orignal pointer,
  1445.                                           copy new string */
  1446.  
  1447.     To change only the "goodbye" msg.
  1448.  
  1449. IN YOUR source code:
  1450. char logoff_msg[40] = "Thanks for calling\n";  /* Max 40 allocated in lib  */
  1451. strcpy(*(ck_logoff_msgs + 5), logoff_msg);     /* Use the original pointer */
  1452.  
  1453.     Again, you can provide your own array of pointers and change  all
  1454.     the messages to any size desired.  Look at the ckitdemo.c, ckitdemo.h.
  1455.  
  1456.                                                  System  Global Variables
  1457.  
  1458.        ck_gen_msgs                  pcboard.sys door.sys wildcat! generic
  1459.        ------------------------------------------------------------------
  1460.        defined as:    char    **ck_gen_msgs;
  1461.  
  1462.        Description:
  1463.  
  1464.     This is pointer to an array of pointers that are C-KIT's internal
  1465.     messages. The array of pointers has a length of 12 elements.
  1466.     The code looks for an array of pointers to index which message to
  1467.     print.  This pointer to the general array of pointers allows you to
  1468.     define your own array of pointers to the 12 internal messages.  The
  1469.     messages can be of any length and which  message printed will be based
  1470.     their position in the array.
  1471.     The ordering of the array is -
  1472.  
  1473.  0  -  Screen display on message
  1474.  1  -  Event pending warning, time adjusted
  1475.  2  -  Press enter to continue message, used with FORCE_ENTER.
  1476.  3  -  Sysop chat active msg
  1477.  4  -  Sysop chat end msg
  1478.  5  -  Sysop exited to DOS msg
  1479.  6  -  Sysop back from DOS msg
  1480.  7  -  (Enter=none)? msg used in get_defn() and get_defen()
  1481.  8  -  (Enter=yes)   msg used in get_defyn()
  1482.  9  -  (Enter=no)    msg used in get_defyn()
  1483.  10 -  (Enter) or (Y)es, (N)o, (NS)nonstop? msg used in no_more & display_file
  1484.  11 -  More:   - msg used in no_more and display_file
  1485.  
  1486.     ck_gen_msgs = &ckitmsgs[0];   /* Set pointer to custom message ptrs */
  1487.  
  1488.     You do NOT have to define these  messages.  C-KIT has it's own internal
  1489.     defaults.  If you want to change just one individual message and
  1490.     leave the rest alone, then you can use the pointer  that is initially
  1491.     contained in **ck_gen_msgs and index to the one you want to change.
  1492.     Doing this will limit the size to the max. indicated for that message.
  1493.     The limits on changing individual general internal library messages are:
  1494.  
  1495.         MAX SIZE!
  1496.         ========
  1497.         msg0[18]  /* internal "Screen on"        msg   */
  1498.         msg1[44]  /* internal "Event pending"    msg   */
  1499.         msg2[28]  /* internal "Enter to cont."   msg   */
  1500.         msg3[48]  /* internal "Sysop Chat"       msg   */
  1501.         msg4[18]  /* internal "Chat end"         msg   */
  1502.         msg5[42]  /* internal "Exit to DOS"      msg   */
  1503.         msg6[40]  /* internal "Return from DOS"  msg   */
  1504.         msg7[14]  /* internal "prompt1"          msg   */
  1505.         msg8[12]  /* internal "prompt2"          msg   */
  1506.         msg9[10]  /* internal "prompt3"          msg   */
  1507.         msg10[38] /* internal "prompt4"          msg   */
  1508.         msg11[6]  /* internal "More:  "          msg   */
  1509.  
  1510.                                                  System  Global Variables
  1511.        ck_gen_msgs  <cont.>
  1512.        ------------------------------------------------------------------
  1513.  
  1514.     To change only one internal general library message, use the pointer
  1515.     that is originally contained in **ck_gen_msgs.  Indexing from it,
  1516.     you can use strcpy() to change it.  EXAMPLE:
  1517.  
  1518.     To change only the "Screen display on" msg.
  1519.  
  1520. IN YOUR source code:
  1521. char display_msg[18] = "<Screen ON>";  /* Max 18 allocated in lib */
  1522. strcpy(*(ck_gen_msgs), display_msg);   /* Using the orignal pointer,
  1523.                                           copy new string */
  1524.  
  1525.     To change only the "Exited to DOS" msg.
  1526.  
  1527. IN YOUR source code:
  1528. char dos_ret_msg[42] = "Sysop exited to DOS\n";  /* Max 42 allocated in lib  */
  1529. strcpy(*(ck_gen_msgs + 6), dos_ret_msg);         /* Use the original pointer */
  1530.  
  1531.     Again, you can provide your own array of pointers and change  all
  1532.     the messages to any size desired.  Look at the ckitdemo.c, ckitdemo.h.
  1533.  
  1534.  
  1535.  
  1536.        ck_system_time_HHMMSS[]      pcboard.sys door.sys wildcat! generic
  1537.        ------------------------------------------------------------------
  1538.        Defined as:    char    ck_system_time_HHMMSS[9];
  1539.  
  1540.        Description:   This string will contain the current system time
  1541.                       in the form HH:MM:SS and is available for general use.
  1542.  
  1543.  
  1544.        ck_todays_date_MMDDYY[]      pcboard.sys door.sys wildcat! generic
  1545.        ------------------------------------------------------------------
  1546.        Defined as:    char    ck_todays_date_MMDDYY[9];
  1547.  
  1548.        Description:   This string will contain the current system date
  1549.                       in the form MM:DD:YY and is available for general use.
  1550.  
  1551.  
  1552.        ck_error_msg11[]             pcboard.sys door.sys wildcat! generic
  1553.        ------------------------------------------------------------------
  1554.        Defined as:    char    ck_error_msg11[40];
  1555.  
  1556.        Description:   Error message used by display_file.  If you do not
  1557.                       define this, C-KIT will default to it's standard
  1558.                       error message.  MAX. 40 chars. (not including NULL).
  1559.  
  1560.        ck_chatmode                  pcboard.sys door.sys wildcat! generic
  1561.        ------------------------------------------------------------------
  1562.        Defined as:    short   ck_chatmode;
  1563.  
  1564.        Description:   This variable will a 1 (TRUE) if chat mode or a
  1565.                       sysop drop to DOS has been active.  Use this to
  1566.                       re-fresh your screen if needed. It is YOUR responsiblity
  1567.                       to de-assert the variable after you have used it.
  1568.                       (set to FALSE)
  1569.  
  1570.                                                  System  Global Variables
  1571.        ck_DOTS
  1572.        ------------------------------------------------------------------
  1573.        Defined as:    BYTE   ck_DOTS;
  1574.  
  1575.        Description:   This variable when set to a non-zero value will
  1576.                       echo that value (character) to the to the remote/
  1577.                       local screens when using input() or get_cmdline().
  1578.                       For instance, setting ck_DOTS to a '.' will cause
  1579.                       dots to be echoed to the screen.  Handy for using
  1580.                       with passwords etc.  Resetting back to a NULL will
  1581.                       resume normal operations.
  1582.  
  1583.  
  1584.  
  1585.                                                        Standard Data Types
  1586.  
  1587.                                Standard Data Types
  1588.  
  1589.        CKIT.H  defines a number of useful data types.
  1590.  
  1591.        BYTE
  1592.        -------------------------------------------------------------------
  1593.        Defined As:    typedef unsigned char  BYTE;
  1594.  
  1595.        Description:   The  BYTE data type is useful in serial communications
  1596.                       since it provides an easier and more logical way of
  1597.                       handling 8 bit data from UART's used in serial
  1598.                       communications.
  1599.  
  1600.  
  1601.  
  1602.  
  1603.                                                                  Functions
  1604.  
  1605.                                     Functions
  1606.  
  1607.        The  C-KIT Library contains a variety  of functions.
  1608.        They are described as follows:
  1609.  
  1610.        Summary:       Presents  an exact syntactic  model for each  of the
  1611.                       C-KIT Library functions.
  1612.  
  1613.        Description:   Describes a function's purpose and how it is used in
  1614.                       an application program.
  1615.  
  1616.        Return Value:  Explains  any of the  possible return values  for a
  1617.                       C-KIT Library function.
  1618.  
  1619.        See Also:      Lists any similar or related C-KIT Library  function.
  1620.  
  1621.        Example:       Illustrates how  a  C-KIT Library  function could
  1622.                       actually be used in an application program.
  1623.                       Most function listed in the examples will be simply
  1624.                       listed as function().  This may not indicate how
  1625.                       they are called.  To see how they are prototyped and
  1626.                       called go to that function's page.
  1627.                       I.E. If open_door is used in an example (other than
  1628.                       it's own example) it may be simply refered to as
  1629.                       open_door().
  1630.                       In reality open_door is really open_door(char * ...);
  1631.  
  1632.        The library functions are classified as 3 different types.
  1633.        High level, intermediate and low level.   Normally a door would
  1634.        not need to make use of any of the functions except the high
  1635.        level functions.  These handle and watch all the system
  1636.        timeouts, carrier detects, keyboard timeouts etc.
  1637.        If you need more control, there are other functions available.
  1638.        I will warn you.  The lower level function you use, the less
  1639.        it will check for you automatically.  Do not use these unless
  1640.        you have to.
  1641.  
  1642.                                                                  Functions
  1643.        ck_open_door
  1644.        -------------------------------------------------------------------
  1645.        Summary:       #include "ckit.h"
  1646.                       short ck_open_door();
  1647.  
  1648.        Description:  The open door function initializes vectors, reads bbs
  1649.                      system information.    THIS MUST BE CALLED FIRST!
  1650.                      The first pointer should be be the path/name to the
  1651.                      system file. The second pointer should be the path/name
  1652.                      to the users file, if you designated USERSFILE=TRUE.
  1653.                      open_door() will also accept a pointer to a data
  1654.                      structure if ck_NOSYSTEM is TRUE.
  1655.                      (for pcboard systems only).  As long as you have defined
  1656.                      USERSFILE = FALSE, C-KIT will not attempt to use the
  1657.                      second pointer. Which ever you specify, the PORT:AAAA:X
  1658.                      (if used) must be the last parameter passed to
  1659.                      open_door();.
  1660.                      Close_door MUST be called before exiting program  after a
  1661.                      call to open_door. See the CKITDEMO.C for more examples.
  1662.  
  1663.        Return Value:  Will return NULL is successful, otherwise it will return
  1664.                       an error code listed below.
  1665.  
  1666.        See Also:      ck_close_door
  1667.  
  1668.        Example:  This example assumes the path\filenames passed on the command
  1669.                   line.  i.e  program_name path\filename path\filename port
  1670.  
  1671.        #include "ckit.h"
  1672.        short     result;
  1673.        main(int argc, char **argv) {
  1674.          if (argc > 0) {
  1675.            if(!ck_open_door(argv[1], argv[2], argv[3]));    <--- NOTE:
  1676.                   display_info();                                argv[2] and
  1677.                   your_main_program();                           argv[3] are
  1678.            } else {                                              optional.
  1679.                   printf("Error opening door!");                 see below.
  1680.            }
  1681.            ck_close_door();
  1682.            exit(0);
  1683.          }
  1684.        }
  1685.  
  1686.     open_door() returns these codes:
  1687.  
  1688.         0   ;Successful
  1689.         1   ;Unable to open BBS system file (pcboard.sys,door.sys etc)
  1690.         2   ;Problem reading BBS system file
  1691.         3   ;Unrecognized BBS file type
  1692.         4   ;Unable to open pcboard USERS file
  1693.         5   ;Invalid User record or problem seeking to user record
  1694.         6   ;Problem reading USER record
  1695.         7   ;PORT command syntax error
  1696.         8   ;Fossil driver specified but no Fossil driver installed
  1697.             ;or Digiboard driver not installed
  1698.         9   ;Memory allocation problem
  1699.  
  1700.  
  1701.                                                                  Functions
  1702.        ck_open_door  <cont.>
  1703.        -------------------------------------------------------------------
  1704.  
  1705. NOTE: Both PORT and USERSFILE are optional. If a user of your door needed to
  1706. specify a non-standard port address and IRQ, then the syntax is PORT:AAAA:X
  1707. where AAAA is the base address (hex) and X is the IRQ (0-15 decimal). It
  1708. doesn't matter whether PORT:AAAA:X is the second or third parameter
  1709. (depending on if you were opening the user file) passed to open_door() as
  1710. long as it is the LAST parameter passed.
  1711.  
  1712. Note also it does not matter which order on the cmd line the arguments are
  1713. listed. The only thing that matters is which order they are passed to the
  1714. open_door() function itself.  You could also have the system path as part of
  1715. a config file for your door.  Then you would read your config file and pass
  1716. the path read from it to open_door() as a string ptr.
  1717. PORT is optional, and C-KIT will default to standard addresses and irq's
  1718. if PORT is not used based on the port number read from the BBS file.
  1719. C-KIT will assume COM1 = 03F8 IRQ 4, COM2 = 02E8 IRQ3, COM3 = 03E8 IRQ4
  1720. and COM4 = 02E8 IRQ 3.  If the sysop had a different non-standard
  1721. port address and irq, he could then use the PORT cmd to change the
  1722. defaults.  For this reason, you should include the usage of PORT in
  1723. your door program and documenation.
  1724.  
  1725. Below is some examples of how your program would/could be called up
  1726. and how the open_door() function would be called.  Notice PORT is always
  1727. the second or third (last) argument to be passed if a user of your door
  1728. program wanted to use it.
  1729.  
  1730.   C-KIT will also support the use of FOSSIL drivers.  The syntax for a FOSSIL
  1731. driver is: PORT:F:P. The 'F' tells C-KIT to use a Fossil driver for it's
  1732. communications.  The 'P' following it tells it which port to use for the
  1733. Fossil. Example - PORT:F:1, tells C-KIT to use a fossil driver for port 1.
  1734.  
  1735. Digiboard Intelligent Async boards are  supported thru the Universal
  1736. DOS driver for Digiboard.  The syntax is the same as the Fossil driver
  1737. except you replace the F with D and give the channel number to use.
  1738. Example - PORT:D:6 tells C-KIT (your door) that it is connected to a
  1739. Digiboard and to use channel 6 on the Digiboard.
  1740.  
  1741. YOU AS A DOOR AUTHOR SHOULD ALSO INCLUDE THIS INFORMATION IN YOUR DOOR
  1742. DOCUMENTATION FILES AND INCLUDE IT IN YOUR CALL TO OPEN_DOOR().
  1743.  
  1744. open_door() works like this.  It will expect the first pointer to
  1745. be a string pointer to the BBS system file, always.  Next, it checks
  1746. to see if USERSFILE = TRUE.  If so, it will expect the second pointer
  1747. to be a string pointer to a PCBoard users file.  If USERSFILE is
  1748. FALSE it will not look for a users file.  Either case, open_door()
  1749. will search the stack frame pointers for the word "PORT" for the
  1750. 2nd and 3rd string pointers passed.  If it finds it, it will utilize
  1751. it.  If not, it will use the default port addresses/irq's defined
  1752. above for the COM port read from the system file.  For this reason,
  1753. open_door() will work whether there is actually a port command being
  1754. passed or not.  You as the door author should provide the users of your
  1755. door the ability to pass the port command if they are using NON-STANDARD
  1756. ports.
  1757.  
  1758.  
  1759.                                                                  Functions
  1760.        ck_open_door (cont.)
  1761.        -------------------------------------------------------------------
  1762.  
  1763. EXAMPLES: Assume door.cfg below is a config file that your door programs reads.
  1764. This all depends on how or what is desired for your door program.  You would
  1765. need to document in your door documentation what order the cmd line should
  1766. be for your door program, OR read your config file and pass the system name
  1767. and path to open_door().  You should also include info about the PORT:AAAA:X
  1768. in your docs and include that argument to open_door() as well.
  1769.  
  1770. Here is a short example of reading a config file and passing the system
  1771. name and path.
  1772.  
  1773. (Assuming the 1st line in the config file has the system path\name)
  1774.     main(int argc, char **argv) {
  1775.     short   handle, bytes_read;
  1776.     char    bbssyspath[81];
  1777.  
  1778.     handle = open(argv[1], O_RDONLY);             /* Open config file */
  1779.     bytes_read = read(handle, bbssyspath, 80);    /* Read system path\name */
  1780.     bbssyspath[bytes_read - 1] = '\0';            /* Null terminate */
  1781.     close(handle);                                /* Close config file */
  1782.     ck_open_door(bbssyspath, argv[2]);      /* include arg2 for the PORT cmd */
  1783.     ck_close_door();
  1784.  
  1785.     }
  1786.  
  1787. Your program's cmd line for the above could be any one of the following:
  1788.  
  1789. doorprgm  config.cfg                    ;Using standard ports
  1790. doorprgm  config.cfg PORT:03E8:12       ;Using non-standard port and irq 12
  1791. doorprgm  config.cfg PORT:F:1           ;Using a fossil driver on port 1
  1792. doorprgm  config.cfg PORT:D:5           ;Using Digiboard channel 5
  1793.  
  1794.  You may not need or want a config file for your door program so you could
  1795.  just simply have the sysop pass the system infomation on the command line.
  1796.  If this is the case, your program's cmd line could be any of the following:
  1797.  
  1798. doorprgm c:\wc\callinfo.bbs              ;Using standard ports
  1799. doorprgm c:\wc\callinfo.bbs PORT:03F8:5  ;Using non-standard port, irq 5
  1800. doorprgm c:\wc\callinfo.bbs PORT:F:1     ;Using a fossil driver on port 1
  1801. doorprgm  config.cfg PORT:D:7            ;Using Digiboard channel 7
  1802.  
  1803.   Again, you as the door author would explain in your documentation how the
  1804. sysop would set your door program up depending on how you decide to handle
  1805. reading the system files.  Just be sure and include information about the
  1806. PORT:AAAA:X, PORT:F:x, and the PORT:D:x commands as well.
  1807.  
  1808.  
  1809.                                                                  Functions
  1810.        ck_open_door (cont.)
  1811.        -------------------------------------------------------------------
  1812.  
  1813. HIGHLY RECOMMEDED!:
  1814.      You should include in your door source code C's atexit() function.
  1815. Then have it call a function that will test if door_open() has been called
  1816. or if close_door() has already been called.  Then if your program has a
  1817. runtime error, you will call close_door() so all interrupts vectors can be
  1818. restored and prevent a system crash.  Take a look at ckitdemo.c.
  1819. EXAMPLE:
  1820.  
  1821. short       OPENED;             /* Flag to know if open_door has been called  */
  1822. short       CLOSED;             /* Flag to know if close_door has beeb called */
  1823. void        shut_down(void);    /* Shuts door down if normal or error occurs. */
  1824.  
  1825. main(int argc, char **argv) {
  1826.  
  1827.         open_door(argv[1], argv[2]);
  1828.         OPENED = TRUE;              /* Door has been opened  */
  1829.         atexit(shut_down);
  1830.         .
  1831.         .
  1832.         .
  1833.  }
  1834.  
  1835. /****************************************************************************
  1836.  *      Close door, reset vectors etc.                                      *
  1837.  *  Need in case of a run time error occurs in door                         *
  1838.  *  and to check if a call to close_door needs to be made.                  *
  1839.  ****************************************************************************/
  1840.  void   shut_down(void) {
  1841.     if(OPENED && !CLOSED) {
  1842.         close_door();
  1843.         CLOSED = TRUE;
  1844.     }
  1845. }
  1846.  
  1847.  
  1848.                                                                  Functions
  1849.        ck_open_door (cont.)
  1850.        -------------------------------------------------------------------
  1851.  
  1852.   Another way open_door() can be used is thru the use of a data structure
  1853. defined as:
  1854.  
  1855. typedef struct ckitgeneric {
  1856.     char port[6];                   /* COM:?  */
  1857.     short min_left;                 /* minutes left */
  1858. };
  1859.  
  1860. This allows you to support BBS programs in your door program that are not
  1861. supported directly by Ckit.  To do this, you would read the BBS system
  1862. file yourself.  Obtain the necassary information for the data structure,
  1863. set ck_NOSYSTEM = TRUE, then call open_door().  Below is a short example
  1864. of reading a WWIV file.  (WWIV is not directly supported by CKIT).
  1865.  
  1866.  
  1867. typedef struct ckitgeneric {
  1868.     char port[6];            /* COM:x  (COM0: is local) */
  1869.     short min_left;          /* minutes left */
  1870. };
  1871.  
  1872. struct ckitgeneric  ck_gen;  /* You can name this whatever you want */
  1873.  
  1874. char *ptr;
  1875.  
  1876. if(WWIV) {
  1877.      open_file(bbs_system_file);
  1878.      read_file(bbs_system_file);
  1879.      setup_ck_gen();                    /* set up data structure */
  1880.      ck_NOSYSTEM = TRUE;
  1881.      ptr = &bbs_system_file);
  1882. } else {
  1883.      ptr = &bbs_system_file;
  1884.      ck_NOSYSTEM = FALSE;
  1885. }
  1886.  
  1887. open_door(ptr,  argv[2]); (2nd arg is for passing the PORT:AAAA:X cmd)
  1888. (AAAA = port address in hexidecimal,  X = IRQ number in decimal)
  1889. Take a look at the ckitdemo.c file for a complete example.
  1890.  
  1891.  
  1892.  
  1893.                                                            Functions
  1894.        ck_close_door                             high level
  1895.        -------------------------------------------------------------------
  1896.        Summary:       #include "ckit.h"
  1897.                       void ck_close_door(void);
  1898.  
  1899.        Description:   The close door function resets vectors, closes
  1900.                       files opened and prints the log off message.
  1901.                       THIS MUST BE CALLED LAST and ONLY after open_door().
  1902.                       Close_door MUST be called before exiting program
  1903.                       after a call has been made to open_door.
  1904.                       Not doing so will certainly cause a system lock up.
  1905.                       See above for using C's atexit() function.
  1906.                       Version 2.0 and above, close_door will check if
  1907.                       open_door has been called or if close_door() has
  1908.                       already been called to help further prevent any
  1909.                       system hangups.
  1910.  
  1911.        Return Value:  No value is returned.
  1912.  
  1913.        See Also:      ck_open_door.
  1914.  
  1915.        Example:
  1916.  
  1917.        #include "ckit.h"
  1918.        main(int argc, char **argv) {
  1919.          if (argc > 0) {
  1920.            ck_open_door("d:\wc\callinfo.bbs");
  1921.            .
  1922.            .
  1923.            .
  1924.            . your door program
  1925.            .
  1926.            .
  1927.            ck_close_door();
  1928.          };
  1929.        };
  1930.  
  1931.  
  1932.                                                                  Functions
  1933.  
  1934.        ck_update_user      PCBOARD 14.5 only        high level
  1935.        -------------------------------------------------------------------
  1936.        Summary:       #include "ckit.h"
  1937.                       void ck_update_user();
  1938.  
  1939.        Description:   The update user will accept a POINTER to the
  1940.                       user structure member to update.  See the
  1941.                       user structure above.  This function will only
  1942.                       work for PCBoard 14.5 and USERSFILE must be set
  1943.                       TRUE.  C-KIT will update the user file when the
  1944.                       door is closed.  If you do not want C-KIT to update
  1945.                       the user record after a change has been made
  1946.                       set USERSFILE = FALSE before calling close_door();
  1947.                       If you use this function you should set the compiler
  1948.                       to use WORD alignment for C-kit v.2.01 and below.
  1949.                       NOTE: IN VERSION 2.08 AND ABOVE, YOU NEED TO USE
  1950.                             BYTE ALIGNMENT!
  1951.  
  1952.        Return Value:  No value is returned.
  1953.  
  1954.        See Also:      ck_user structure
  1955.  
  1956.        Example: Change user security and comment1 field.
  1957.                 MOTICE THE & BELOW!.  You MUST pass the address of the
  1958.                 member to update in the user structure.
  1959.  
  1960.        #include "ckit.h"
  1961.        main(int argc, char **argv) {
  1962.        USERSFILE = TRUE;
  1963.        static char new_comment[] = "ckit_user";
  1964.        if (argc > 1) {
  1965.            ck_open_door(argv[1], argv[2]); (pass system file and PORT cmd)
  1966.            .
  1967.            .
  1968.            .
  1969.            ck_usersecurity = 50;
  1970.            ck_update_user(&ck_usersecurity);
  1971.            strcpy(ck_usercomment1, new_comment);
  1972.            ck_update_user(&ck_usercomment1);
  1973.            .
  1974.            .
  1975.            .
  1976.            ck_close_door();
  1977.          };
  1978.        };
  1979.  
  1980.                                                                  Functions
  1981.  
  1982.        ck_s_puts                                  high level
  1983.        -------------------------------------------------------------------
  1984.        Summary:       #include "ckit.h"
  1985.                       void ck_s_puts(char *);
  1986.  
  1987.        Description:   The s_puts function displays a single NULL termintated
  1988.                       (C string) to the local and remote console. It expects
  1989.                       a pointer to the string of type BYTE or char
  1990.                       to be displayed.  It will not handle ANSI.  See
  1991.                       ck_s_putstd() for ANSI and other usage.
  1992.  
  1993.        Return Value:  No value is returned.
  1994.  
  1995.        See Also:      s_printf, ck_s_putv, ck_s_putc, ck_s_putsn
  1996.  
  1997.        Example:
  1998.  
  1999.        #include "ckit.h"
  2000.        static BYTE string[] = "This is a test";
  2001.        main(int argc, char **argv) {
  2002.          if (argc > 1) {
  2003.            ck_open_door(argv[1]); /* pass system file(s) */
  2004.            .
  2005.            .
  2006.            .
  2007.            ck_s_puts(string);
  2008.            ck_s_puts("This is also a test");
  2009.            .
  2010.            .
  2011.            .
  2012.            ck_close_door();
  2013.          };
  2014.        };
  2015.  
  2016.  
  2017.                                                                 Functions
  2018.  
  2019.        ck_s_putstd                                  high level
  2020.        -------------------------------------------------------------------
  2021.        Summary:       #include "ckit.h"
  2022.                       void ck_s_putstd(char *);
  2023.  
  2024.        Description:   The s_putstd function displays a single NULL termintated
  2025.                       (C string) to the local and remote console. It expects
  2026.                       a pointer to the string of type BYTE or char
  2027.                       to be displayed. This function is identical to s_puts
  2028.                       except it uses std output.
  2029.                       This function should be used when ANSI code, or CTRL
  2030.                       chars are needed to be sent to the local and remote
  2031.                       consoles.
  2032.  
  2033.        Return Value:  No value is returned.
  2034.  
  2035.        See Also:      s_printf, ck_s_putv, ck_s_putc, ck_s_putsn
  2036.  
  2037.        Example:       Use s_putstd() to change background/foreground colors
  2038.                       #include "ckit.h"
  2039.  
  2040.        #define cyanblue        0
  2041.        #define yellowbrown     1
  2042.        #define redgreen        2
  2043.        #define redcyan         3
  2044.        #define cyanred         4
  2045.        #define cyanmagenta     5
  2046.        #define bluegrey        6
  2047.  
  2048.        static char *ansi_color[8]  = {
  2049.           "\33[0;1;36;44mCyan on Blue\33[40m"
  2050.           "\33[44m\33[33;43mYellow on Brown\33[40m"
  2051.           "\33[43m\33[0;31;42mRed on Green\33[40m"
  2052.           "\33[42m\33[46mRed on Cyan\33[40m"
  2053.           "\33[46m\33[1;36;41mCyan on Red\33[40m"
  2054.           "\33[41m\33[45mCyan on Magenta\33[40m"
  2055.           "\33[45m\33[0;34;47mBlue on Grey\33[0m"
  2056.        };
  2057.  
  2058.        main(int argc, char **argv) {
  2059.          if (argc > 0) {
  2060.            ck_open_door(argv[1]); /* pass system file(s) */
  2061.            .
  2062.            .
  2063.            .
  2064.            ck_s_putstd(ansi_color[cyanblue]);
  2065.            ck_s_putstd(ansi_color[yellowbrown]);
  2066.            ck_s_putstd(ansi_color[redgreen]);
  2067.            ck_s_putstd(ansi_color[redcyan]);
  2068.            ck_s_putstd(ansi_color[cyanred]);
  2069.            ck_s_putstd(ansi_color[cyanmagenta]);
  2070.            ck_s_putstd(ansi_color[bluegrey]);
  2071.            .
  2072.            .
  2073.            .
  2074.            ck_close_door();
  2075.          };
  2076.        };
  2077.  
  2078.  
  2079.                                                                  Functions
  2080.  
  2081.        ck_s_putv                                    high level
  2082.        -------------------------------------------------------------------
  2083.        Summary:       #include "ckit.h"
  2084.                       void ck_s_putv();
  2085.  
  2086.        Description:   The s_putv function displays a single NULL terminated
  2087.                       (C string) to the local and remote console. It expects
  2088.                       a variable argument of pointer(s) to the string(s)
  2089.                       of type BYTE or char to be displayed.  The list of
  2090.                       pointers MUST end with a NULL pointer!.  Not doing
  2091.                       so will most likely either cause garbage to printed
  2092.                       or even a hang-up.
  2093.  
  2094.        Return Value:  No value is returned.
  2095.  
  2096.        See Also:      s_printf, ck_s_puts, ck_s_putc, ck_s_putsn
  2097.  
  2098.        Example:       This example prints 2 strings with the pointer list
  2099.                       terminated with a NULL pointer.
  2100.  
  2101.        #include "ckit.h"
  2102.        static BYTE string[] = "This is a test";
  2103.        main(int argc, char **argv) {
  2104.          if (argc > 1) {
  2105.            ck_open_door(argv[1]); /* pass system file(s) */
  2106.            .
  2107.            .
  2108.            .
  2109.            static BYTE string[] = "This is a test";
  2110.            ck_s_putv(string, "This is also a test", NULL);
  2111.            .
  2112.            .
  2113.            .
  2114.            ck_close_door();
  2115.          };
  2116.        };
  2117.  
  2118. NOTE: an alternative to using s_putv would be to include the function
  2119.       s_printf() below in your source code.  You could use this function
  2120.       the same as you would printf();  This function has already been protyped
  2121.       in CKIT.H
  2122.  
  2123.  
  2124.                                                                  Functions
  2125.        s_printf                               high level
  2126.        -------------------------------------------------------------------
  2127.        Summary:       #include "ckit.h"
  2128.                       void    s_printf(char *,...);
  2129.  
  2130.        Description:   The s_printf function is used to format an output
  2131.                       to be sent to the local and remote console. It is
  2132.                       exactly the same as the cprintf() function in C.
  2133.                       To use it, you must include the source code listed
  2134.                       below in your door program since s_printf() is NOT an
  2135.                       actual part of the C-KIT librarys.
  2136.                       NOTE: if you want to send ANSI strings, change the
  2137.                       s_puts in the s_printf function to s_putstd or create
  2138.                       another std_printf function using s_putstd as the
  2139.                       output.
  2140.  
  2141.        Return Value:  No value is returned.
  2142.  
  2143.        See Also:      s_printf, s_puts, s_putv
  2144.  
  2145. INCLUDE THIS SOURCE CODE IN YOUR DOOR PROGRAM TO USE S_PRINTF!
  2146. THE FUNCTION HAS ALREADY BEEN PROTOTYPED IN CKIT.H
  2147. MODIFY AS YOU NEED.
  2148. /****************************************************************************
  2149.  *      Printf() function for sending output to port                        *
  2150.  ****************************************************************************/
  2151. void s_printf(char *s_format,...) {
  2152.     va_list arg_pointer;
  2153.     char buffer[82];                    /*  string buffer for 81 chars */
  2154.     va_start(arg_pointer, s_format);
  2155.     vsprintf(buffer, s_format, arg_pointer);
  2156.     s_putstd(buffer);                  /* change to s_putstd() for ANSI */
  2157.     va_end(arg_pointer);
  2158. }
  2159.  
  2160.        Example:
  2161. /****************************************************************************
  2162.  *      sending a string out the port using s_printf()                      *
  2163.  ****************************************************************************/
  2164.        #include "ckit.h"
  2165.        short  number  34;
  2166.        main(int argc, char **argv) {
  2167.          if (argc > 1) {
  2168.            ck_open_door("c:\rbbs\dorinfo1.def", argv[1]);
  2169.            .
  2170.            .
  2171.            .
  2172.            s_printf("Hello, %s. The number is %d.", firstname, number);
  2173.            .
  2174.            .
  2175.            .
  2176.            ck_close_door();
  2177.          };
  2178.        };
  2179.  
  2180.  
  2181.                                                                  Functions
  2182.  
  2183.        ck_s_putsn                                   high level
  2184.        -------------------------------------------------------------------
  2185.        Summary:       #include "ckit.h"
  2186.                       void ck_s_putsn(char *);
  2187.  
  2188.        Description:   The s_putsn function displays a single NULL terminated
  2189.                       (C string) to the local console only.       It expects
  2190.                       a pointer to the string of type BYTE or char
  2191.                       to be displayed.
  2192.  
  2193.        Return Value:  No value is returned.
  2194.  
  2195.        See Also:      s_printf, ck_s_putv, ck_s_putc, ck_s_putstd
  2196.  
  2197.        Example:
  2198.  
  2199.        #include "ckit.h"
  2200.        static BYTE string[] = "This is a test";
  2201.        main(int argc, char **argv) {
  2202.          if (argc > 1) {
  2203.            ck_open_door(argv[1], argv[2]); (include arg2 for the PORT cmd)
  2204.            .
  2205.            .
  2206.            .
  2207.            static BYTE string[] = "This is a test";
  2208.            ck_s_putsn(string);
  2209.            ck_s_putsn("This is also a test");
  2210.            .
  2211.            .
  2212.            .
  2213.            ck_close_door();
  2214.          };
  2215.        };
  2216.  
  2217.  
  2218.                                                                  Functions
  2219.  
  2220.        ck_s_putc                                high level
  2221.        -------------------------------------------------------------------
  2222.        Summary:       #include "ckit.h"
  2223.                       void ck_s_putc(BYTE);
  2224.  
  2225.        Description:   The s_putc function displays a single BYTE or char
  2226.                       to the local and remote console.
  2227.  
  2228.        Return Value:  No value is returned.
  2229.  
  2230.        See Also:      s_printf, ck_s_puts, ck_s_putc.
  2231.  
  2232.        Example:       This example prints a single BYTE (ASCII A) to local
  2233.                       and remote console.
  2234.  
  2235.        #include "ckit.h"
  2236.        BYTE byte_to_send = 0x41;
  2237.        short   handle, bytes_read;
  2238.        char    pcbsyspath[81];
  2239.        main(int argc, char **argv) {
  2240.        if (argc > 1) {
  2241.             handle = open(argv[1], O_RDONLY);
  2242.             bytes_read = read(handle, pcbsyspath, 80);
  2243.             pcbsyspath[bytes_read - 1] = '\0';
  2244.             close(handle);
  2245.             open_door(pcbsyspath, argv[2]); (include arg2 for the PORT cmd)
  2246.             ck_s_putc(byte_to_send);
  2247.             ck_close_door();
  2248.           };
  2249.        };
  2250.  
  2251.                                                                 Functions
  2252.  
  2253.        ck_newline                               high level
  2254.        -------------------------------------------------------------------
  2255.        Summary:       #include "ckit.h"
  2256.                       void ck_newline(void);
  2257.  
  2258.        Description:   The newline function sends a Carriage Return/
  2259.                       Line Feed to the local and remote console.
  2260.                       Increments ck_linenum.
  2261.  
  2262.        Return Value:  No value is returned.
  2263.  
  2264.        See Also:      s_printf, ck_s_puts, ck_s_putc, ck_linenum
  2265.  
  2266.        Example:       This example prints single CR/LF to local
  2267.                       and remote console.
  2268.  
  2269.        #include "ckit.h"
  2270.        main(int argc, char **argv) {
  2271.          if (argc > 1) {
  2272.            ck_open_door(argv[1]), argv[2]);
  2273.            .
  2274.            .
  2275.            .
  2276.            ck_newline();
  2277.            .
  2278.            .
  2279.            .
  2280.            ck_close_door();
  2281.          };
  2282.        };
  2283.  
  2284.  
  2285.                                                                  Functions
  2286.  
  2287.        ck_clear_row                             high level
  2288.        -------------------------------------------------------------------
  2289.        Summary:       #include "ckit.h"
  2290.                       void ck_clear_row(short);
  2291.  
  2292.        Description:   The clear_row function clears a given row on screen
  2293.                       of the local and remote console. (row = 1 - 24).
  2294.                       Used only if caller is in GRAPHICS or ansi_ng mode.
  2295.  
  2296.        Return Value:  No value is returned.
  2297.  
  2298.        See Also:      ck_clear_eol, ck_clr_screen.
  2299.  
  2300.        Example:       This example prints a string on a line, then
  2301.                       erases the string.
  2302.  
  2303.        #include ckit.h
  2304.        char prompt1 = "Enter filename to view: ";
  2305.        main(int argc, char **argv) {
  2306.          if (argc > 1) {
  2307.            ck_open_door(argv[1], argv[2]); (pass system file and port cmd)
  2308.            ck_pos_cursor(10, 1);
  2309.            ck_s_puts(prompt1);
  2310.            ck_pos_cursor(11, 1);
  2311.            ck_s_puts("Ready to clear above row, press a key");
  2312.            while(!(wait_keypress())) {
  2313.          };
  2314.          ck_clear_row(10);  /* clear row 10 */
  2315.          ck_newline();
  2316.          ck_close_door();
  2317.        };
  2318.  
  2319.  
  2320.                                                                  Functions
  2321.  
  2322.        ck_clear_eol                             high level
  2323.        -------------------------------------------------------------------
  2324.        Summary:       #include "ckit.h"
  2325.                       void ck_clear_eol(void);
  2326.  
  2327.        Description:   The clear_eol function clears to the end of line
  2328.                       from current cursor position.
  2329.                       Used only if caller is in GRAPHICS or ansi_ng mode.
  2330.  
  2331.        Return Value:  No value is returned.
  2332.  
  2333.        See Also:      ck_clear_eol, ck_clr_screen.
  2334.  
  2335.        Example:       This example clears to end of line on screen of
  2336.                       local and remote console.
  2337.  
  2338.        #include ckit.h
  2339.        char prompt1 = "Enter filename to view: ";
  2340.        main(int argc, char **argv) {
  2341.          if (argc > 1) {
  2342.            ck_open_door("c:\wildcat\callinfo.bbs", "PORT:03E8:5");
  2343.            ck_newline();
  2344.            ck_s_puts("Press a key to clear end of line below");
  2345.            ck_newline();
  2346.            ck_s_putv(prompt1, "\r", NULL);
  2347.            while(!(wait_keypress())) {
  2348.            };
  2349.            ck_clear_eol();
  2350.            ck_newline();
  2351.            ck_close_door();
  2352.          };
  2353.        };
  2354.  
  2355.  
  2356.                                                                  Functions
  2357.  
  2358.        ck_clr_screen                             high level
  2359.        -------------------------------------------------------------------
  2360.        Summary:       #include "ckit.h"
  2361.                       void ck_clr_screen(void);
  2362.  
  2363.        Description:   The clr_screen function clears entire screen of local
  2364.                        and remote console in either ASCII, GRAPHIC, or
  2365.                        ansi_ng mode.
  2366.  
  2367.        Return Value:  No value is returned.
  2368.  
  2369.        See Also:      ck_clear_screen.
  2370.  
  2371.        Example:       This example clears screen of local/remote console.
  2372.  
  2373.        #include ckit.h
  2374.        main(int argc, char **argv) {
  2375.          if (argc > 1) {
  2376.            ck_open_door(argv[1]);
  2377.            .
  2378.            .
  2379.            .
  2380.            ck_clr_screen();
  2381.            .
  2382.            .
  2383.            .
  2384.            ck_close_door();
  2385.          };
  2386.        };
  2387.  
  2388.                                                                  Functions
  2389.  
  2390.        ck_clear_screen                           high level
  2391.        -------------------------------------------------------------------
  2392.        Summary:       #include "ckit.h"
  2393.                       void ck_clear_screen(void);
  2394.  
  2395.        Description:   The clear_screen function clears entire screen of
  2396.                       local console including status line.
  2397.  
  2398.        Return Value:  No value is returned.
  2399.  
  2400.        See Also:      ck_clr_screen.
  2401.  
  2402.        Example:       This example clears screen of local console.
  2403.  
  2404.        #include ckit.h
  2405.        main(int argc, char **argv) {
  2406.          if (argc > 1) {
  2407.            ck_open_door(argv[1]);
  2408.            .
  2409.            .
  2410.            .
  2411.            ck_clear_screen();
  2412.            .
  2413.            .
  2414.            .
  2415.            ck_close_door();
  2416.          };
  2417.        };
  2418.  
  2419.  
  2420.                                                                  Functions
  2421.  
  2422.        ck_pos_cursor                             high level
  2423.        -------------------------------------------------------------------
  2424.        Summary:       #include "ckit.h"
  2425.                       void ck_pos_cursor(short, short);
  2426.  
  2427.        Description:   The pos_cursor function positions cursor at
  2428.                       row, column using ANSI. Caller must be in GRAPHICS,
  2429.                       or ansi_ng mode. If not no action will take place.
  2430.                       row = 1 to 25, column = 1 to 80.  C-KIT will not
  2431.                       let the local screen position cursor in status
  2432.                       line area.
  2433.  
  2434.        Return Value:  No value is returned.
  2435.  
  2436.        Example:       This example positions cursor at row 10, column 15
  2437.                       on the local/remote consoles.
  2438.  
  2439.        #include "ckit.h"
  2440.        short     row = 10;
  2441.        short     column = 15;
  2442.        main(int argc, char **argv) {
  2443.          if (argc > 1) {
  2444.            ck_open_door(argv[1]);
  2445.            .
  2446.            .
  2447.            .
  2448.            ck_pos_cursor(row, column);
  2449.            .
  2450.            .
  2451.            .
  2452.            ck_close_door();
  2453.          };
  2454.        };
  2455.  
  2456.                                                                  Functions
  2457.  
  2458.        ck_set_r_c                                high level
  2459.        -------------------------------------------------------------------
  2460.        Summary:       #include "ckit.h"
  2461.                       void ck_set_r_c(short, short);
  2462.  
  2463.        Description:   The set_r_c function positions cursor at
  2464.                       row, column using BIOS on the local screen.
  2465.                       row = 1 to 25 (23), column = 1 to 80.
  2466.                       C-KIT will not let the cursor be placed in the
  2467.                       status line area of local screen.
  2468.  
  2469.        Return Value:  No value is returned.
  2470.  
  2471.        Example:       This example positions cursor at row 5, column 1
  2472.                       on the local console.
  2473.  
  2474.        #include "ckit.h"
  2475.  
  2476.        short     row = 5;
  2477.        short     column = 1;
  2478.  
  2479.        main(int argc, char **argv) {
  2480.          if (argc > 1) {
  2481.            ck_open_door(argv[1]);
  2482.            .
  2483.            .
  2484.            .
  2485.            ck_set_r_c(row, column);
  2486.            .
  2487.            .
  2488.            .
  2489.            ck_close_door();
  2490.          };
  2491.        };
  2492.  
  2493.                                                                  Functions
  2494.  
  2495.        ck_back_space                             high level
  2496.        -------------------------------------------------------------------
  2497.        Summary:       #include "ckit.h"
  2498.                       void ck_back_space(short);
  2499.  
  2500.        Description:   The back_space function backspaces cursor short number
  2501.                       of spaces or to the 1st char in row, whichever is 1st.
  2502.                       This is a destrutive backspace.
  2503.  
  2504.        Return Value:  No value is returned.
  2505.  
  2506.        Example:       This example backspaces cursor over the prompt and
  2507.                       on the user's input local/remote consoles.
  2508.  
  2509.        #include ckit.h
  2510.  
  2511.        char prompt1 = "Enter filename to view: ";
  2512.  
  2513.        main(int argc, char **argv) {
  2514.          if (argc > 1) {
  2515.            ck_open_door("c:\pcb\pcboard.sys", "PORT:02E8:4");
  2516.            ck_s_puts("\r\nReady to test back_space()");
  2517.            ck_s_puts("Press a key when ready");
  2518.            ck_newline();
  2519.            while(!(wait_keypress())) {
  2520.          };
  2521.          ck_color(yellow);
  2522.          ck_s_puts(prompt1);
  2523.          ck_color(red);
  2524.          ck_get_cmdline();
  2525.          ck_back_space(strlen(prompt1) + strlen(cmdline));
  2526.          ck_close_door();
  2527.        };
  2528.  
  2529.  
  2530.                                                                  Functions
  2531.  
  2532.        ck_color                                  high level
  2533.        -------------------------------------------------------------------
  2534.        Summary:       #include "ckit.h"
  2535.                       void ck_color(short);
  2536.  
  2537.        Description:   The color function selects color to use using ANSI.
  2538.                       Caller must be in GRAPHICS mode.  If not, no action
  2539.                       is taken.  ck_color will only set the forground color
  2540.                       and leave the background color as it was.
  2541.  
  2542.        Return Value:  No value is returned.
  2543.  
  2544.        See Also:      Color macros above in macro section used with C-KIT
  2545.  
  2546.        Example:       This example sets color to red  on the local/remote
  2547.                       consoles.(see color macros in ckit.h)
  2548.  
  2549.            #include "ckit.h"
  2550.            main(int argc, char **argv) {
  2551.              if (argc > 1) {
  2552.                ck_open_door(argv[1]);
  2553.                .
  2554.                .
  2555.                .
  2556.                ck_color(red);
  2557.                .
  2558.                .
  2559.                .
  2560.                ck_close_door();
  2561.              };
  2562.            };
  2563.  
  2564.                                                                 Functions
  2565.  
  2566.        ck_set_ANSI                               high level
  2567.        -------------------------------------------------------------------
  2568.        Summary:       #include "ckit.h"
  2569.                       short  ck_set_ANSI(short)
  2570.  
  2571.        Description:   Allows manual program changing of ANSI capability.
  2572.                       Excepts either TRUE/FALSE.   Normally when C-kit
  2573.                       first opens a system file it determines from the file
  2574.                       whether the user wants ANSI control, (ansi_NG will
  2575.                       be set, GRAPHICS FALSE) OR if they wanted ANSI control
  2576.                       with graphics (ansi_NG false, GRAPHICS TRUE).  This
  2577.                       information is not available for generic.sys.
  2578.                       ck_set_ANSI allows people using the generic.sys file
  2579.                       to select ANSI control and/or ANSI control with
  2580.                       graphics.
  2581.  
  2582.        Return Value:  Returns whatever is passed to it.
  2583.  
  2584.        See Also:      ck_graphics, ck_ansi_ng
  2585.  
  2586.        Example:       This example turns on ANSI capability without
  2587.                       graphics.
  2588.  
  2589.            #include "ckit.h"
  2590.            main(int argc, char **argv) {
  2591.              if (argc > 1) {
  2592.                ck_open_door(argv[1]);
  2593.                .
  2594.                .
  2595.                .
  2596.                ansi_ng |= TRUE;  /* Set ansi_ng */
  2597.                graphics &= FALSE;
  2598.                .
  2599.                .
  2600.                .
  2601.                ck_set_ANSI(ansi_ng | graphics);
  2602.                .
  2603.                .
  2604.                .
  2605.                ck_close_door();
  2606.              };
  2607.            };
  2608.  
  2609.                                                                  Functions
  2610.  
  2611.        ck_get_cmdline                            high level
  2612.        -------------------------------------------------------------------
  2613.        Summary:       #include "ckit.h"
  2614.                       void ck_get_cmdline(void);
  2615.  
  2616.        Description:   Read a line of input (max 128 bytes). Echo to
  2617.                       screen, leave cursor after the last key typed before
  2618.                       C/R. Automatically checks for time_left, carrier.
  2619.                       Calls ck_input() and reads into array *cmdline,
  2620.                       automatically maps input to Uppercase.
  2621.                       Will also set key_source to source of input.
  2622.                       *defined in CKIT.H.  This function is the one
  2623.                       you would normally use for ALL user input.
  2624.                       ALL other input functions are intermediate or low
  2625.                       level functions.  Setting ck_DOTS = char will cause
  2626.                       char to be echoed to the remote/local console.
  2627.                       Filters all ASCII control charactors below 31 dec. out.
  2628.  
  2629.        Return Value:  No value is returned.
  2630.  
  2631.        See Also:      ck_input, ck_get_nextpar, ck_key_source, ck_wait_keypress
  2632.  
  2633.        Example:       This example reads keyboard  from local/remote
  2634.                       console into array get_cmdline[].  It also checks
  2635.                       for any scan_codes receieved.  See Ckitdemo.c also.
  2636.  
  2637.             #include "ckit.h"
  2638.             main(int argc, char **argv) {
  2639.             ck_open_door(argv[1]);
  2640.             do {
  2641.                 ck_newline();
  2642.                 display_time();
  2643.                 ck_color(green);
  2644.                 ck_s_puts("Command? ");
  2645.                 ck_get_cmdline();          /* read input into 'cmdline'  */
  2646.  
  2647.             } while((ck_DUMP_USER != TRUE) && (strlen(ck_cmdline) == 0) \
  2648.                    && (ck_scan_code == 0));
  2649.         }
  2650.         if (ck_DUMP_USER == TRUE) {
  2651.             ck_close_door();
  2652.             exit(1);
  2653.         }
  2654.         if (ck_scan_code != NULL) {
  2655.             ck_color(white);
  2656.             read_scancode();
  2657.             ck_newline();
  2658.         }
  2659.         if (ck_get_nextpar()) { /* scan next parameter from cmdline into par */
  2660.             ck_newline();
  2661.       /* process commands */
  2662.             switch ( par[0] ) {
  2663.                 case 'A':
  2664.                 ansi_demo();
  2665.                 break;
  2666.                 default:
  2667.                 ck_color(magenta);
  2668.                 ck_s_putv("(",par,") is not allowed!  Try again:", NULL);
  2669.                 *ck_cmdline = NULL;
  2670.             }
  2671.         }
  2672.  
  2673.  
  2674.                                                                  Functions
  2675.  
  2676.        ck_wait_keypress                          high level
  2677.        -------------------------------------------------------------------
  2678.        Summary:       #include "ckit.h"
  2679.                       short ck_wait_keypress(void);
  2680.  
  2681.        Description:   Waits for any keypress. Does not wait for a C/R.
  2682.                       Autochecks for CARRIER,  TIMEOUTS etc.
  2683.  
  2684.                       Returns ASCII code of key pressed or TRUE if
  2685.                       ck_DUMP_USER goes TRUE otherwise it will return FALSE.
  2686.                       Will also return TRUE if extended key is pressed.
  2687.                       Will not do so if a sysop function key is pressed.
  2688.                       Useful for "hot_key" applications. Will also set
  2689.                       key_source to proper value.
  2690.  
  2691.        Return Value:  ASCII code of keypressed or TRUE, FALSE
  2692.  
  2693.        See also: ck_check_CR, ck_check_keypress, ck_input, ck_get_cmdline
  2694.  
  2695.        Example:      This example will wait until a keypress or ck_DUMP_USER.
  2696.  
  2697.        #include "ckit.h"
  2698.  
  2699.        prompt2 = ""Press any key to continue";
  2700.  
  2701.        main(int argc, char **argv) {
  2702.          if (argc > 1) {
  2703.            ck_open_door(argv[1]);
  2704.            .
  2705.            .
  2706.            .
  2707.            ck_color(yellow);
  2708.            ck_newline();
  2709.            ck_s_puts(prompt2);
  2710.            while(!(ck_wait_keypress())) {
  2711.            };
  2712.            ck_back_space(strlen(prompt2) + 1);
  2713.            .
  2714.            .
  2715.            .
  2716.            ck_close_door();
  2717.          };
  2718.        };
  2719.  
  2720.  
  2721.                                                                  Functions
  2722.  
  2723.        ck_force_enter                            high level
  2724.        -------------------------------------------------------------------
  2725.        Summary:       #include "ckit.h"
  2726.                       void ck_force_enter(void);
  2727.  
  2728.        Description:   Prompts " Press Enter to continue: ", wait for C/R,
  2729.                       automatic carrier, time_left and sysop checks.
  2730.  
  2731.        Return Value:  NONE
  2732.  
  2733.        Example:       This example displays a string then prompts and
  2734.                       forces user to press C/R to continue.
  2735.  
  2736.        #include "ckit.h"
  2737.        main(int argc, char **argv) {
  2738.          if (argc > 1) {
  2739.            ck_open_door(argv[1]);
  2740.            .
  2741.            .
  2742.            .
  2743.            ck_color(yellow);
  2744.            ck_s_puts("Display this string\r\n");
  2745.            ck_force_enter();
  2746.            .
  2747.            .
  2748.            .
  2749.            ck_close_door();
  2750.          };
  2751.        };
  2752.  
  2753.  
  2754.                                                                  Functions
  2755.  
  2756.        display_time                              high level
  2757.        -------------------------------------------------------------------
  2758.        Summary:       #include "ckit.h"
  2759.                       void display_time(void);
  2760.  
  2761.        Description:   Displays (xxxx used, xxx left).
  2762.                       In CKIT2.0 and above, this function is not in
  2763.                       the library.  Instead, using the source code
  2764.                       below will do the same thing as previous
  2765.                       display_time().
  2766.  
  2767.        Return Value:  NONE
  2768.  
  2769.        See Also: mins_left_system(), system_time_used()
  2770.  
  2771.        Example:   See CKITDEMO.C also
  2772.  
  2773.        #include "ckit.h"
  2774.        main(int argc, char **argv) {
  2775.          ck_open_door(argv[1]);
  2776.          if (argc > 1) {
  2777.             ck_open_door(system_ptr, port_cmd_ptr);
  2778.             .
  2779.             .
  2780.             .
  2781.             display_time();
  2782.             .
  2783.             .
  2784.             .
  2785.        };
  2786.  
  2787.        void display_time(void) {
  2788.             color(yellow);
  2789.             ck_s_puts("(");
  2790.             ck_color(green);
  2791.             s_printf("%d used, ", system_time_used()+prev_used);
  2792.             ck_color(red);
  2793.             s_printf("%d left",  mins_left_system()+time_credit);
  2794.             ck_color(yellow);
  2795.             ck_s_puts(") ");
  2796.        }
  2797.  
  2798.  
  2799.                                                                  Functions
  2800.  
  2801.        ck_get_cmdline_raw                        high level
  2802.        -------------------------------------------------------------------
  2803.        Summary:       #include "ckit.h"
  2804.                       void ck_get_cmdlinaw(short);
  2805.  
  2806.        Description:   Same as get_cmdline() above but erases prompt of
  2807.                       after input and user input also.  Expects length
  2808.                       of prompt to be passed to it.
  2809.  
  2810.        Return Value:  No value is returned.
  2811.  
  2812.        See Also:      ck_get_cmdline, ck_get_nextpar, ck_get_cmdline, ck_input
  2813.  
  2814.        Example:       This example reads keyboard  from local/remote
  2815.                       console into array cmdline[], (filename), then
  2816.                       displays file.
  2817.  
  2818.        #include "ckit.h"
  2819.  
  2820.        char prompt1 = "Enter filename to display: ";
  2821.  
  2822.        main(int argc, char **argv) {
  2823.          if (argc > 1) {
  2824.            ck_open_door(argv[1]);
  2825.            ck_s_puts(prompt1);
  2826.            ck_get_cmdline_raw(strlen(prompt1));
  2827.            ck_newline();
  2828.            ck_display_file(cmdline);
  2829.            ck_close_door();
  2830.          };
  2831.        };
  2832.  
  2833.  
  2834.                                                                  Functions
  2835.  
  2836.        ck_get_nextpar                            high level
  2837.        -------------------------------------------------------------------
  2838.        Summary:       #include "ckit.h"
  2839.                       char ck_get_nextpar(void);
  2840.  
  2841.        Description:   Scans next stacked command from cmdline[] array
  2842.                       into "par[]".  par defined in CKIT.H
  2843.  
  2844.        Return Value:  Returns 0 if none available, non-zero if cmd available
  2845.  
  2846.        See Also:      input, get_cmdline, cmdline and par in GLOBAL section.
  2847.  
  2848.        Example:       This example reads keyboard  from local/remote
  2849.                       console into array get_cmdline[], then calls
  2850.                       get_nextpar to scan for cmds entered.
  2851.  
  2852.      #include "ckit.h"
  2853.  
  2854.      main(int argc, char **argv) {
  2855.        if (argc > 1) {
  2856.          ck_open_door(argv[1]);
  2857.          do {
  2858.             ck_get_cmdline();    /* read input into 'cmdline'  */
  2859.          } while( (ck_DUMP_USER != TRUE) && ( strlen(cmdline) == 0 ));
  2860.          if (ck_get_nextpar()) { /* scan next parameter from cmdline into par */
  2861.          /* process commands */
  2862.             switch ( ck_par[0] ) {
  2863.                 case 'A':
  2864.                 ansi_demo();
  2865.                 break;
  2866.                 default:
  2867.                 break;
  2868.             };
  2869.          };
  2870.        };
  2871.       ck_close_door();
  2872.      };
  2873.  
  2874.                                                                  Functions
  2875.  
  2876.        ck_nomore                                 high level
  2877.        -------------------------------------------------------------------
  2878.        Summary:       #include "ckit.h"
  2879.                       short ck_nomore(void);
  2880.  
  2881.        Description:   Displays prompt:
  2882.                       "More: (Enter) or (Y)es, (N)o, (NS)nonstop? ".
  2883.                        Returns 0 = Non_stop
  2884.                                1 = Yes
  2885.                                2 = No
  2886.  
  2887.                       Also checks for CTRL K.
  2888.                       The "More:" prompt will be yellow,
  2889.                       the rest will be green.
  2890.  
  2891.        Return Value: short value, meaning described above/
  2892.  
  2893.        See Also:      ck_get_def, ck_get_defyn, ck_get_defen
  2894.  
  2895.        Example:       This example loops 3 times to show what each
  2896.                       keypress (N,Y or NS) returns.
  2897.        #include "ckit.h"
  2898.  
  2899.        short      result, i;
  2900.  
  2901.        main(int argc, char **argv) {
  2902.          if (argc > 1) {
  2903.            ck_open_door(argv[1]);
  2904.            for(i=0; i <= 2; i++) {
  2905.              ck_s_puts("\r\nReady to test NOMORE 3 times");
  2906.              ck_newline();
  2907.              while(!(ck_wait_keypress())) {
  2908.              };
  2909.              result = ck_nomore();
  2910.              printf("Nomore() returned  %d", result);
  2911.              ck_newline();
  2912.           };
  2913.        ck_close_door();
  2914.        };
  2915.  
  2916.                                                                  Functions
  2917.  
  2918.        ck_get_defyn                              high level
  2919.        -------------------------------------------------------------------
  2920.        Summary:       #include "ckit.h"
  2921.                       void ck_get_defyn(char *, short)
  2922.  
  2923.        Description:   Displays prompt string and either
  2924.                       "Enter=yes " or "Enter=no" based on short value.
  2925.                       1st prompt will be yellow, default will be green.
  2926.                       If short is Non_zero it will display "Enter=Yes".
  2927.                       If short is Zero (NULL) it will display "Enter=No".
  2928.                       Calls get_cmdline for user input.
  2929.  
  2930.        Return Value:  None
  2931.  
  2932.        See Also:      ck_cmd_line, ck_get_def, ck_get_defyn, ck_get_defen
  2933.  
  2934.        Example:       This example loops 2 times to show what each
  2935.                       value or i displays.
  2936.        #include "ckit.h"
  2937.  
  2938.        short i;
  2939.  
  2940.        main(int argc, char **argv) {
  2941.          if (argc > 1) {
  2942.            ck_open_door(argv[1]);
  2943.            for(i=0; i <= 1; i++) {
  2944.              ck_s_puts("\r\nReady to test get_defyn()");
  2945.              ck_newline();
  2946.              ck_get_defyn("Continue? ", i);
  2947.              ck_s_putv("You entered ", cmdline, NULL);
  2948.              ck_newline();
  2949.           };
  2950.        ck_close_door();
  2951.        };
  2952.  
  2953.                                                                  Functions
  2954.  
  2955.        ck_get_defen                              high level
  2956.        -------------------------------------------------------------------
  2957.        Summary:       #include "ckit.h"
  2958.                       void ck_get_defen(char *)
  2959.  
  2960.        Description:   Same as get_defyn except the default string
  2961.                       "(Enter=none?) " will be appended.
  2962.                       1st prompt will be yellow, default will be green.
  2963.                       Calls get_cmdline for user input.
  2964.  
  2965.        Return Value:  None
  2966.  
  2967.        See Also:      ck_cmd_line, ck_get_def, ck_get_defyn, ck_get_defen
  2968.  
  2969.        Example:
  2970.  
  2971.        #include "ckit.h"
  2972.  
  2973.        main(int argc, char **argv) {
  2974.          if (argc > 1) {
  2975.            ck_open_door(argv[1]);
  2976.            ck_s_puts("\r\nReady to test get_defne()");
  2977.            ck_newline();
  2978.            ck_get_defne("Enter filename? ");
  2979.            ck_s_putv("You entered ", cmdline, NULL);
  2980.            ck_newline();
  2981.        ck_close_door();
  2982.        };
  2983.  
  2984.                                                                  Functions
  2985.  
  2986.        ck_getdef                                 high level
  2987.        -------------------------------------------------------------------
  2988.        Summary:       #include "ckit.h"
  2989.                       void   ck_get_def(char *, char *)
  2990.  
  2991.        Description:   Same as get_defen except both colored prompts
  2992.                       are user defineable.  The 1st prompt will be
  2993.                       yellow, the 2nd one green.
  2994.                       Calls get_cmdline for user input.
  2995.        Return Value:  None
  2996.  
  2997.        See Also:      ck_cmd_line, ck_get_def, ck_get_defyn, ck_get_defen
  2998.  
  2999.        Example:       Print 2 prompts, and print user input.
  3000.  
  3001.        static  char prompt1 = "Enter filename? "
  3002.        static  char prompt2 = "(Enter = quit)";
  3003.  
  3004.        #include "ckit.h"
  3005.  
  3006.        main(int argc, char **argv) {
  3007.          if (argc > 1) {
  3008.            ck_open_door(argv[1]);
  3009.            ck_s_puts("\r\nReady to test get_def()");
  3010.            ck_newline();
  3011.            ck_get_def(prompt1, prompt2);
  3012.            ck_s_putv("You entered ", cmdline, NULL);
  3013.            ck_newline();
  3014.        ck_close_door();
  3015.        };
  3016.  
  3017.                                                                  Functions
  3018.  
  3019.        ck_prompt_def                             high level
  3020.        -------------------------------------------------------------------
  3021.        Summary:       #include "ckit.h"
  3022.                       void ck_prompt_def(char *, char *)
  3023.  
  3024.        Description:   Same as get_def except it does not call
  3025.                       get_cmdline. 1st prompt will be yellow,
  3026.                       2nd prompt green.
  3027.  
  3028.        Return Value:  None
  3029.  
  3030.        See Also:      ck_cmd_line, ck_get_def, ck_get_defyn, ck_get_defen
  3031.  
  3032.        Example:       Print 2 prompts.
  3033.  
  3034.        static  char prompt1 = "Enter filename? "
  3035.        static  char prompt2 = "(Enter = quit)";
  3036.  
  3037.        #include "ckit.h"
  3038.  
  3039.        main(int argc, char **argv) {
  3040.          if (argc > 1) {
  3041.            ck_open_door(argv[1]);
  3042.            ck_s_puts("\r\nReady to test prompt_def()");
  3043.            ck_newline();
  3044.            ck_prompt_def(prompt1, prompt2);
  3045.            ck_get_cmdline();
  3046.            ck_newline();
  3047.        ck_close_door();
  3048.        };
  3049.  
  3050.                                                                  Functions
  3051.  
  3052.        ck_getdefn                                high level
  3053.        -------------------------------------------------------------------
  3054.        Summary:       #include "ckit.h"
  3055.                       void   ck_get_defn(char *, char *)
  3056.  
  3057.        Description:   Same as get_def except appends "Enter=none" to end.
  3058.                       Calls get_cmdline for user input.
  3059.  
  3060.        Return Value:  None
  3061.  
  3062.        See Also:      ck_cmd_line, ck_get_def, ck_get_defyn, ck_get_defen
  3063.  
  3064.  
  3065.                                                                  Functions
  3066.  
  3067.        ck_dos_shell                              high level
  3068.        -------------------------------------------------------------------
  3069.        Summary:       #include "ckit.h"
  3070.                       short ck_dos_shell(char *, char *);
  3071.  
  3072.        Description:   Will execute program pointed arg1, arg2 is passed
  3073.                       as command line arguments to the program.
  3074.                       arg2 must be < 128 chars. (DOS limit).
  3075.                       This function uses spawnlp() to execute the program.
  3076.                       If you plan on doing any shells, you need to use this
  3077.                       function since it will disable the keyboard timer
  3078.                       while the shell is taking place and perform some other
  3079.                       clean up's upon re-entry.  This call uses C's
  3080.                       spawnlp() function, as P_WAIT.
  3081.  
  3082.        Return Value:  -1 = error (check 'C's GLOBAL _errno), NULL = NO error
  3083.  
  3084.        See also: F5 local shell to DOS, and CKITDEMO.C
  3085.  
  3086.        Example:  Download a file using Zmodem taken from CKITDEMO.C
  3087.  
  3088.    #include "ckit.h"
  3089.  
  3090.    char    zmodem_cmds[128];     /* Buffer to build Zmodem command   */
  3091.  
  3092.    main(int argc, char **argv) {
  3093.      if (argc > 1) {
  3094.        ck_open_door(argv[1]);
  3095.        .
  3096.        .
  3097.        .
  3098.     color(green);
  3099.     s_printf("\nReady to send %s. Press <ENTER> to begin.",doc_filename);
  3100.     while(DUMP_USER != TRUE) {
  3101.           if( check_CR() ) {
  3102.             break;
  3103.         }
  3104.     }
  3105.    sprintf(zmodem_cmds, "portx %X,%X pB4096 pa3000 handshake cts sz %s", \
  3106.             uart_base, irq, doc_filename);
  3107.     if(dos_shell("dsz", zmodem_cmds)) {
  3108.         s_puts("\n\aTransfer aborted");
  3109.     } else {
  3110.         s_puts("\nTransfer complete");
  3111.     }
  3112.        .
  3113.        .
  3114.        .
  3115.        ck_close_door();
  3116.      };
  3117.    };
  3118.  
  3119.  
  3120.                                                                  Functions
  3121.  
  3122.        ck_shell_entry();       Registered users only high level
  3123.        -------------------------------------------------------------------
  3124.        Summary:       #include "ckit.h"
  3125.                       void ck_shell_entry();
  3126.  
  3127.        Description:   This routines works with ck_shell_exit()
  3128.                       to do cleanup/maintenance before and after
  3129.                       a call to a spawn routine.   This will allow a
  3130.                       user to use any of C's spawn functions
  3131.                       Both ck_shell_entry() and ck_shell_exit()
  3132.                       MUST called before and after a spawn, respectfully.
  3133.  
  3134.        NOTE:          The old CKIT function ck_dos_shell() is still
  3135.                       operational for compatibility but may be removed in
  3136.                       future updates.  Therefore it is recommended you
  3137.                       change your code to  use these routines instead.
  3138.  
  3139.        Return Value:  NONE
  3140.  
  3141.        See also: ck_shell_exit(), ck_dos_shell()
  3142.  
  3143.        Example:  ZIP a file using PKZIP,  taken from CKITDEMO.C
  3144.  
  3145.    #include "ckit.h"
  3146.  
  3147.    char    pkzname[12];                /* PKZIP batch file name  */
  3148.    char    zip_filename[9] ="CKITDOC"; /* Name for PKZIP file    */
  3149.    char    pkzcmds[128];               /* PKZIP commands         */
  3150.  
  3151.    main(int argc, char **argv) {
  3152.      if (argc > 1) {
  3153.        ck_open_door(argv[1]);
  3154.        .
  3155.        .
  3156.        .
  3157.        pkzname[9] = '\0';
  3158.        strcpy(pkzname, "ZIP.BAT");
  3159.        color(green);
  3160.        if(strstr(pkzname, ".BAT")) {
  3161.         ck_shell_entry();               /* Prepare CKIT for a DOS Shell */
  3162.         sprintf(pkzcmds, "-a %s ckit.doc", zip_filename);
  3163.         errorlevel = spawnlp( P_WAIT, pkzname, pkzname, pkzcmds, NULL );
  3164.         ck_shell_exit();                /* Clean up after a shell  */
  3165.       } else {
  3166.         ck_shell_entry();               /* Prepare CKIT for a DOS Shell */
  3167.         sprintf(pkzcmds, "-a %s ckit.doc", zip_filename);
  3168.         errorlevel = spawnlp(P_WAIT, pkzname, pkzname, pkzcmds, NULL );
  3169.         ck_shell_exit();                /* Clean up after a shell  */
  3170.       }
  3171.        .
  3172.        ck_close_door();
  3173.      };
  3174.    };
  3175.  
  3176.                                                                  Functions
  3177.  
  3178.        ck_shell_exit();        Registered users only  high level
  3179.        -------------------------------------------------------------------
  3180.        Summary:       #include "ckit.h"
  3181.                       void ck_shell_exit();
  3182.  
  3183.        Description:   This routines works with ck_shell_entry()
  3184.                       to do cleanup/maintenance before and after
  3185.                       a call to a spawn routine.   This will allow a
  3186.                       user to use any of C's spawn functions
  3187.                       Both ck_shell_entry() and ck_shell_exit()
  3188.                       MUST called before and after a spawn, respectfully.
  3189.  
  3190.        NOTE:          The old CKIT function ck_dos_shell() is still
  3191.                       operational for compatibility but may be removed in
  3192.                       future updates.  Therefore it is recommended you
  3193.                       change your code to  use these routines instead.
  3194.  
  3195.        Return Value:  NONE
  3196.  
  3197.        See also: ck_shell_exit(), ck_dos_shell()
  3198.  
  3199.        Example:  ZIP a file using PKZIP,  taken from CKITDEMO.C
  3200.  
  3201.    #include "ckit.h"
  3202.  
  3203.    char    pkzname[12];                /* PKZIP batch file name  */
  3204.    char    zip_filename[9] ="CKITDOC"; /* Name for PKZIP file    */
  3205.    char    pkzcmds[128];               /* PKZIP commands         */
  3206.  
  3207.    main(int argc, char **argv) {
  3208.      if (argc > 1) {
  3209.        ck_open_door(argv[1]);
  3210.        .
  3211.        .
  3212.        .
  3213.        pkzname[9] = '\0';
  3214.        strcpy(pkzname, "ZIP.BAT");
  3215.        color(green);
  3216.        if(strstr(pkzname, ".BAT")) {
  3217.         ck_shell_entry();               /* Prepare CKIT for a DOS Shell */
  3218.         sprintf(pkzcmds, "-a %s ckit.doc", zip_filename);
  3219.         errorlevel = spawnlp( P_WAIT, pkzname, pkzname, pkzcmds, NULL );
  3220.         ck_shell_exit();                /* Clean up after a shell  */
  3221.       } else {
  3222.         ck_shell_entry();               /* Prepare CKIT for a DOS Shell */
  3223.         sprintf(pkzcmds, "-a %s ckit.doc", zip_filename);
  3224.         errorlevel = spawnlp(P_WAIT, pkzname, pkzname, pkzcmds, NULL );
  3225.         ck_shell_exit();                /* Clean up after a shell  */
  3226.       }
  3227.        .
  3228.        ck_close_door();
  3229.      };
  3230.    };
  3231.  
  3232.  
  3233.                                                                  Functions
  3234.  
  3235.        ck_display_file                           high level
  3236.        -------------------------------------------------------------------
  3237.        Summary:      #include "ckit.h"
  3238.                      short ck_display_file(char *);
  3239.  
  3240.        Description:  Displays file to local/remote consoles.  Automatic
  3241.                      use of page_length, control K checks, MORE? prompting,
  3242.                      closes file when done. Expects a pointer to name/path
  3243.                      of file to display.  If page_length is 0, the
  3244.                      MORE? prompting will be disabled.  You can use this
  3245.                      to your advantage for files that you do not want
  3246.                      MORE? prompting by setting ck_userpage_length to 0 before
  3247.                      calling display_file().  Just make sure you save the
  3248.                      original value of ck_userpage_length if you need it later
  3249.                      on. This function will not automatically attempt to
  3250.                      display a graphic file if the user is in graphics.
  3251.                      For display non-interruptable menus, set page_length
  3252.                      to NULL before calling this function.
  3253.                      It is up to the door author to decide how he wants
  3254.                      to handle it. see below.  This call is done to
  3255.                      the Borland _open() or MSC _dos_open() libraries as
  3256.                      _open(filename, O_RDONLY | O_DENYNONE);
  3257.                      (share compatible mode)
  3258.  
  3259.        Return Value: Returns  non-zero if error.  If desired, you can then
  3260.                      check the C global _errno for the cause of the problem.
  3261.  
  3262.        See Also:     NONE
  3263.  
  3264.        Example:      This example displays the file ckit.m, then forces
  3265.                      user to press enter when done.
  3266.  
  3267.        #include "ckit.h"
  3268.        main(int argc, char **argv) {
  3269.          if (argc > 1) {
  3270.            ck_open_door(argv[1]);
  3271.            .
  3272.            .
  3273.            .
  3274.            strcpy(filename, "ckit.m")
  3275.            if(!ck_graphics) {
  3276.                (ck_display_file(filename);
  3277.             } else {
  3278.                 strcat(filename,"g");
  3279.                (ck_display_file(filename);
  3280.             }
  3281.            ck_force_enter();
  3282.            .
  3283.            .
  3284.            .
  3285.          };
  3286.          ck_close_door();
  3287.        };
  3288.  
  3289.                                                                  Functions
  3290.  
  3291.        ck_debug_on                               high level
  3292.        -------------------------------------------------------------------
  3293.        Summary:       #include "ckit.h"
  3294.                       void ck_debug_on(void); alias ck_carrier_on();
  3295.  
  3296.        Description:   A call to this function while debugging your door
  3297.                       will disable the keyboard timer among other things
  3298.                       while you are trying to debug your door.  Make
  3299.                       sure you remove this call before releasing your door
  3300.                       or the keyboard timeout will not function!  It should
  3301.                       only be called after open_door();.  This can also
  3302.                       be used if needed to use transmit_modem() while the
  3303.                       door is opened. This will disable ck_DUMP_USER from
  3304.                       going true.  Make sure you turn debug back on!
  3305.                       using debug_off();
  3306.  
  3307.        Return Value:  NONE
  3308.  
  3309.  
  3310.        Example:
  3311.  
  3312.        #include "ckit.h"
  3313.        main(int argc, char **argv) {
  3314.          if (argc > 1) {
  3315.            ck_open_door(argv[1]);
  3316.            .
  3317.            .
  3318.            .
  3319.            ck_debug_on();
  3320.            ck_lower_dtr();    /* Drop user off           */
  3321.            ck_raise_dtr();
  3322.            ck_wait(1);        /* wait for modem to reset */
  3323.            ck_flush_RQUEUE(); /* Flush receive queue     */
  3324.            ck_transmit_modem("ATDT6156907968");
  3325.            ck_debug_off();
  3326.            while(ck_tqueue_len()); /* wait on modem */
  3327.            ck_newline();
  3328.            delay(1);
  3329.            while(ck_DUMP_USER != TRUE) { /* wait for modem */
  3330.              ck_get_cmdline();
  3331.              ck_newline();
  3332.              ck_s_putv("Modem returned -> ",cmdline, NULL);
  3333.              break;
  3334.            };
  3335.            .
  3336.            .
  3337.            .
  3338.          };
  3339.          ck_close_door();
  3340.        };
  3341.  
  3342.  
  3343.                                                                  Functions
  3344.  
  3345.        ck_debug_off                              high level
  3346.        -------------------------------------------------------------------
  3347.        Summary:       #include "ckit.h"
  3348.                       void ck_debug_on(void); alias ck_carrier_off();
  3349.  
  3350.        Description:   After a call to debug_on(), this will re-enable
  3351.                       keyboard timer, etc.
  3352.                       It should only be called after open_door();
  3353.  
  3354.        Return Value:  NONE
  3355.  
  3356.  
  3357.        Example:
  3358.  
  3359.        #include "ckit.h"
  3360.        main(int argc, char **argv) {
  3361.          if (argc > 1) {
  3362.            ck_open_door(argv[1]);
  3363.            ck_debug_on();  /* while debugging door */
  3364.            .
  3365.            .
  3366.            .
  3367.          };
  3368.          ck_debug_off();
  3369.          ck_close_door();
  3370.        };
  3371.  
  3372.  
  3373.  
  3374.                                                                  Functions
  3375.  
  3376.        ck_input                                  intermediate level
  3377.        -------------------------------------------------------------------
  3378.        Summary:       #include "ckit.h"
  3379.                       void ck_input(BYTE *, short);
  3380.  
  3381.        Description:   Read a line of input with specified length. Echo to
  3382.                       screen, leave cursor after the last key typed before
  3383.                       C/R. Automatically checks for time_left, carrier.
  3384.                       Expects a char array pointer to store input and max.
  3385.                       length of input to read.  NOTE: Each call to input()
  3386.                       will purge the buffer in use to NULLS.  MAX length
  3387.                       must not exceed the size of your array and it must
  3388.                       not include the NULL char. (sizeof(array) - 1).
  3389.                       It will also set key_source = 1 or 2. Setting
  3390.                       ck_DOTS = char will cause char to be echoed to the
  3391.                       local/remote consoles.
  3392.  
  3393.        Return Value:  No value is returned.
  3394.  
  3395.        See Also:      ck_get_cmdline(), ck_inkey(), ck_getkey(), ck_key_source
  3396.                       ck_wait_keypress(), ck_check_CTRL_K
  3397.  
  3398.        Example:       This example reads keyboard input from local/remote
  3399.                       console into array usr_input[] with max. bytes to
  3400.                       read equal to 100 bytes. Will set key_source
  3401.                       equal to source of input.
  3402.  
  3403.        NOTE:          This a "intermediate" level function.  You would not
  3404.                       normally need to use this function.  get_cmdline();
  3405.                       would normally be used and will handle all input
  3406.                       for you.
  3407.  
  3408.  
  3409.        #include "ckit.h"
  3410.        main(int argc, char **argv) {
  3411.          if (argc > 1) {
  3412.            ck_open_door(argv[1]);
  3413.            .
  3414.            .
  3415.            .
  3416.            ck_input(&usr_input[0], sizeof(usr_input) - 1);
  3417.            .
  3418.            .
  3419.            .
  3420.            ck_close_door();
  3421.          };
  3422.        };
  3423.  
  3424.                                                                  Functions
  3425.  
  3426.        ck_check_time_left                        intermediate level
  3427.        -------------------------------------------------------------------
  3428.        Summary:       #include "ckit.h"
  3429.                       void ck_check_time_left(void);
  3430.  
  3431.        Description:   Checks time left on system, automatically sets
  3432.                       ck_DUMP_USER if time expired.  Should be included
  3433.                       in all major program loops if you are going to use it.
  3434.  
  3435.        Return Value:  NONE
  3436.  
  3437.        See Also:      display_time, ck_get_cmdline
  3438.  
  3439.        Example:       This function is normally handled by get_cmdline()
  3440.                       and input().  You do not normally need to use it.
  3441.  
  3442.        #include "ckit.h"
  3443.  
  3444.        main(int argc, char **argv) {
  3445.          if (argc > 1) {
  3446.            ck_open_door(argv[1]);
  3447.            .
  3448.            .
  3449.            .
  3450.            ck_check_time_left();
  3451.            if(ck_DUMP_USER == TRUE) {
  3452.              ck_close_door();
  3453.            };
  3454.            .
  3455.            .
  3456.            .
  3457.            ck_close_door();
  3458.          };
  3459.        };
  3460.  
  3461.        ck_mins_left_system                       intermediate level
  3462.        -------------------------------------------------------------------
  3463.        Summary:       #include "ckit.h"
  3464.                       short ck_mins_left_system(void);
  3465.  
  3466.        Description:   Returns the time left in the door, not including
  3467.                       any time_credit given.  Does not set ck_DUMP_USER.
  3468.                       If expired, the time returned will be 0 or
  3469.                       negative minutes.  Does not include any time
  3470.                       credit given in door.
  3471.  
  3472.        Return Value:  short value - minutes remaining in door
  3473.  
  3474.        See Also:      display_time, ck_get_cmdline, time_credit
  3475.  
  3476.        Example:
  3477.  
  3478.        #include "ckit.h"
  3479.  
  3480.        minutes_left;
  3481.        main(int argc, char **argv) {
  3482.          if (argc > 1) {
  3483.            ck_open_door(argv[1]);
  3484.            .
  3485.            .
  3486.            .
  3487.            color(yellow);
  3488.            s_puts("(");
  3489.            color(green);
  3490.            s_printf("%d used, ", system_time_used()+prev_used);
  3491.            color(red);
  3492.            s_printf("%d left",  mins_left_system()+time_credit);
  3493.            color(yellow);
  3494.            s_puts(") ");
  3495.            .
  3496.            .
  3497.            .
  3498.            ck_close_door();
  3499.          };
  3500.        };
  3501.  
  3502.        ck_system_time_used                       intermediate level
  3503.        -------------------------------------------------------------------
  3504.        Summary:       #include "ckit.h"
  3505.                       short ck_system_time_used(void);
  3506.  
  3507.        Description:   Returns the time used in minutes since the
  3508.                       door was opened. Does not set ck_DUMP_USER.
  3509.                       Does not include time prev used in door.
  3510.  
  3511.        Return Value:  short value - minutes used since door opened.
  3512.  
  3513.        See Also:      display_time, prev_used
  3514.  
  3515.        Example:
  3516.  
  3517.        #include "ckit.h"
  3518.  
  3519.        minutes_left;
  3520.        main(int argc, char **argv) {
  3521.          if (argc > 1) {
  3522.            ck_open_door(argv[1]);
  3523.            .
  3524.            .
  3525.            .
  3526.            color(yellow);
  3527.            s_puts("(");
  3528.            color(green);
  3529.            s_printf("%d used, ", system_time_used()+prev_used);
  3530.            color(red);
  3531.            s_printf("%d left",  mins_left_system()+time_credit);
  3532.            color(yellow);
  3533.            s_puts(") ");
  3534.            .
  3535.            .
  3536.            .
  3537.            ck_close_door();
  3538.          };
  3539.        };
  3540.  
  3541.                                                                  Functions
  3542.  
  3543.        ck_adjust_time_allowed                    intermediate level
  3544.        -------------------------------------------------------------------
  3545.        Summary:       #include "ckit.h"
  3546.                       void ck_adjust_time_allowed(short);
  3547.  
  3548.        Description:   Adjust user time left on system. Automatically
  3549.                       updates PCBoard.sys to reflect change.
  3550.                       This function will only be effective on systems
  3551.                       using pcboard.sys.
  3552.  
  3553.        Return Value:  NONE
  3554.  
  3555.        See Also:      
  3556.  
  3557.        Example:  For complete example see CKITDEMO.C included
  3558.  
  3559.        if (ck_get_nextpar()) {  /* scan next parameter from cmdline into par */
  3560.         if (!strcmpi(thinking_of, par)) {
  3561.             ck_color(green);
  3562.             ck_s_puts("That's right!  You get a 10 minute bonus!");
  3563.             ck_adjust_time_allowed(10);
  3564.         } else {
  3565.            ck_color(blue);
  3566.            ck_s_putv("Wrong! You lose 2 minutes! \
  3567.                    I was thinking of ", thinking_of,".",NULL);
  3568.                   adjust_time_allowed(-2);
  3569.         }
  3570.       }
  3571.  
  3572.  
  3573.                                                                  Functions
  3574.  
  3575.        ck_check_event                            intermediate level
  3576.        -------------------------------------------------------------------
  3577.        Summary:       #include "ckit.h"
  3578.                       short ck_check_event(void);
  3579.  
  3580.        Description:   Checks if time left will conflict with event.
  3581.  
  3582.        Return Value:  0 if no conflict, otherwise it will return the
  3583.                       minutes left before event.
  3584.  
  3585.  
  3586.        See Also:      ck_event_minutes, ck_mins_before_event.
  3587.  
  3588.        EXAMPLE:      C-KIT will automatically check for event conflicts.
  3589.                      This function would normally not be used.
  3590.  
  3591.  
  3592.  
  3593.                                                                  Functions
  3594.  
  3595.        ck_event_minutes                          intermediate level
  3596.        -------------------------------------------------------------------
  3597.        Summary:       #include "ckit.h"
  3598.                       short ck_event_minutes(void);
  3599.  
  3600.        Description:   Checks minutes past midnight event is scheduled.
  3601.                       This function is normally handled by C-KIT.
  3602.                       This function would normally not be used.
  3603.  
  3604.        Return Value:  Number of minutes past midnight event is scheduled
  3605.                       to run.
  3606.  
  3607.        See Also:      ck_check_event, ck_mins_before_event.
  3608.  
  3609.        #include "ckit.h"
  3610.  
  3611.        main(int argc, char **argv) {
  3612.          if (argc > 1) {
  3613.            ck_open_door(argv[1]);
  3614.            .
  3615.            .
  3616.            .
  3617.            ck_short   event_mins;
  3618.            ck_event_mins = event_minutes();
  3619.            .
  3620.            .
  3621.            .
  3622.            ck_close_door();
  3623.          };
  3624.        };
  3625.  
  3626.  
  3627.  
  3628.                                                                  Functions
  3629.  
  3630.        ck_mins_before_event                      intermediate level
  3631.        -------------------------------------------------------------------
  3632.        Summary:       #include "ckit.h"
  3633.                       short ck_mins_before_event(void);
  3634.  
  3635.        Description:   Check minutes left before event from current time.
  3636.  
  3637.        Return Value:  Minutes before event from current time.
  3638.  
  3639.        See Also:      ck_check_event, ck_event_minutes.
  3640.  
  3641.        Example:
  3642.  
  3643.        #include "ckit.h"
  3644.  
  3645.        main(int argc, char **argv) {
  3646.          if (argc > 1) {
  3647.            ck_open_door(argv[1]);
  3648.            .
  3649.            .
  3650.            .
  3651.            short  mins_before_event;
  3652.            mins_before_event = ck_mins_before_event();
  3653.            .
  3654.            .
  3655.            .
  3656.            ck_close_door();
  3657.          };
  3658.        };
  3659.  
  3660.  
  3661.                                                                  Functions
  3662.  
  3663.        ck_delay                                  intermediate level
  3664.        -------------------------------------------------------------------
  3665.        Summary:       #include "ckit.h"
  3666.                       void ck_delay(short);
  3667.  
  3668.        Description:   General purpose delay in milliseconds
  3669.                       Minumum of 55 ms.  (short must be >= 1)
  3670.                       This function is good only on the MSC librarys.
  3671.                       The TURBO librarys use Borland's DELAY() function.
  3672.  
  3673.        See also:      ck_wait
  3674.  
  3675.        Return Value:  NONE
  3676.  
  3677.  
  3678.  
  3679.  
  3680.                                                                  Functions
  3681.  
  3682.        ck_wait                                   intermediate level
  3683.        -------------------------------------------------------------------
  3684.        Summary:       #include "ckit.h"
  3685.                       void ck_wait(short);
  3686.  
  3687.        Description:   General purpose delay in seconds
  3688.                       Minumum of 1 sec. for now  (short must be >= 1)
  3689.                       less than one will result in 1/2 second delay.
  3690.                       Use ck_delay above
  3691.  
  3692.  
  3693.        Return Value:  NONE
  3694.  
  3695.        See also:      ck_delay
  3696.  
  3697.  
  3698.  
  3699.                                                                  Functions
  3700.  
  3701.        ck_purge_buffer                           intermediate level
  3702.        -------------------------------------------------------------------
  3703.        Summary:       #include "ckit.h"
  3704.                       void ck_purge_buffer(BYTE *, short);
  3705.  
  3706.        Description:   purge_buffer will purge any buffer to NULLS by
  3707.                       passing a pointer to the buffer and the size of the
  3708.                       buffer. i.e purge_buffer(buffer, 0x80).
  3709.                       This may or may not be useful but is available.
  3710.  
  3711.            NOTE: There is a seperate purge function for the serial port
  3712.            input buffer if you wish to purge it before calling input.
  3713.            See flush_RQUEUE.
  3714.  
  3715.        Return Value:  NONE
  3716.  
  3717.        See also: flush_RQUEUE
  3718.  
  3719.        Example:
  3720.  
  3721.        #include "ckit.h"
  3722.  
  3723.        static BYTE buff[256] = "This is purge buffer test";
  3724.  
  3725.        main(int argc, char **argv) {
  3726.          if (argc > 1) {
  3727.            ck_open_door(argv[1]);
  3728.            .
  3729.            .
  3730.            .
  3731.            ck_purge_buffer(buff, 255);
  3732.            .
  3733.            .
  3734.            .
  3735.            ck_close_door();
  3736.          };
  3737.        };
  3738.  
  3739.  
  3740.  
  3741.                                                                  Functions
  3742.  
  3743.        ck_check_CR                               intermediate level
  3744.        -------------------------------------------------------------------
  3745.        Summary:       #include "ckit.h"
  3746.                       void short ck_check_CR(void);
  3747.  
  3748.        Description:   Check for a carriage return, does not wait, does
  3749.                       not display any prompts.
  3750.                       Returns TRUE or FALSE
  3751.  
  3752.        Return Value:  TRUE, FALSE
  3753.  
  3754.        See also: ck_force_enter(), ck_get_cmdline(), ck_check_keypress()
  3755.  
  3756.  
  3757.  
  3758.                                                                  Functions
  3759.  
  3760.        ck_check_CTRL_K                           intermediate level
  3761.        -------------------------------------------------------------------
  3762.        Summary:       #include "ckit.h"
  3763.                       short ck_check_CTRL_K(void);
  3764.  
  3765.        Description:   Check if a CONTROL K (ASCII 11) has been entered.
  3766.                       Returns TRUE or FALSE
  3767.  
  3768.        Return Value:  TRUE, FALSE
  3769.  
  3770.        See also: ck_CtrlK_OFF, ck_CtrlK_ON
  3771.  
  3772.  
  3773.                                                                  Functions
  3774.  
  3775.        ck_CtrlK_ON                               intermediate level
  3776.        -------------------------------------------------------------------
  3777.        Summary:       #include "ckit.h"
  3778.                       void CtrlK_ON(void);
  3779.  
  3780.        Description:   Enables  CONTROL K (ASCII 11) checking.
  3781.                       This is normally off since most menu types are
  3782.                       non_interruptable.  If turned on, CTRL K will
  3783.                       be recognized.  Once on, you must call CtrlK_OFF()
  3784.                       (see below) to disable it.  CTRL K's are also NOT
  3785.                       put into the input buffer.  You have to use the
  3786.                       check_CTRL_K() function (see above) to determine
  3787.                       if a CTRL K has been pressed.
  3788.  
  3789.        See also:  ck_CtrlK_OFF, ck_check_CTRL_K()
  3790.  
  3791.                                                                  Functions
  3792.  
  3793.        ck_CtrlK_OFF                              intermediate level
  3794.        -------------------------------------------------------------------
  3795.        Summary:       #include "ckit.h"
  3796.                       void ck_CtrlK_OFF(void);
  3797.  
  3798.        Description:   Disables CONTROL K (ASCII 11) checking.
  3799.  
  3800.        See also: ck_CtrlK_ON, ck_check_CTRL_K()
  3801.  
  3802.  
  3803.        ck_set_kybd_time                       intermediate level
  3804.        -------------------------------------------------------------------
  3805.        Summary:       #include "ckit.h"
  3806.                       void ck_set_kybd_time(BYTE, BYTE);
  3807.  
  3808.        Description:   Sets keyboard timer to desired values.
  3809.                       Default is 2 minutes beep and 5 minute timeout.
  3810.  
  3811.         This allows the door author to set the keyboard timer.  The
  3812.         time has a resolution in minutes, with a minimum of 1 minute
  3813.         and a maximum of 255.  The routine expects two numbers.  The
  3814.         first number is the BEEP time.  This sets how many minutes
  3815.         should pass before the keyboard timer gives a warning beep.
  3816.         It will continue to beep afterwards at one  minute intervals.
  3817.         The second number is the actual keyboard timeout value.  It
  3818.         should normally be set to some number higher than the BEEP time.
  3819.         NOTE: Each call to ck_set_kybd_time() will reset the current
  3820.         keyboard timer to zero.
  3821.  
  3822.         Example: Set the BEEP time to 2 minutes and timeout to 6 minutes.
  3823.  
  3824.        #include "ckit.h"
  3825.  
  3826.        main(int argc, char **argv) {
  3827.          if (argc > 1) {
  3828.            ck_open_door(argv[1]);
  3829.            .
  3830.            .
  3831.            .
  3832.            ck_set_kybd_time(2, 6);
  3833.            .
  3834.            .
  3835.            .
  3836.            ck_close_door();
  3837.          };
  3838.        };
  3839.  
  3840.  
  3841.                                                                  Functions
  3842.  
  3843.         NOTE:  ALL the low level functions below are not normally
  3844.                needed and are handled automatically by C-KIT in a
  3845.                higher level function.  Most of these functions
  3846.                do NO carrier detects, etc.  They are only provided
  3847.                in special cases that may need them.  Use with caution.
  3848.  
  3849.        ck_inkey                                  low level
  3850.        -------------------------------------------------------------------
  3851.        Summary:       #include "ckit.h"
  3852.                       BYTE ck_inkey(void);
  3853.  
  3854.        Description:   Read character (if available) from local/remote
  3855.                       console.  Does not wait for input.  Also sets
  3856.                       key_source equal to SYSOP or USER_KEY.  Inkey
  3857.                       will also keep track of time left and set ck_DUMP_USER
  3858.                       if time expires.
  3859.  
  3860.        Return Value:  Returns 0 if none available, otherwise returns key
  3861.                       pressed
  3862.  
  3863.        See Also:      input, sio_getbyte, key_source above in globals,
  3864.                       check_CTRL_K
  3865.  
  3866.        Example:       This example checks for A at the keyboard,
  3867.                       from local/remote console, returns TRUE or FALSE
  3868.  
  3869.        #include "ckit.h"
  3870.  
  3871.        main(int argc, char **argv) {
  3872.          if (argc > 1) {
  3873.            ck_open_door(argv[1]);
  3874.            .
  3875.            .
  3876.            .
  3877.            if ( ck_inkey() != 'A') {
  3878.               return(FALSE);
  3879.            } else {
  3880.               return(TRUE);
  3881.            }
  3882.            .
  3883.            .
  3884.            .
  3885.            ck_close_door();
  3886.          };
  3887.        };
  3888.  
  3889.  
  3890.                                                                  Functions
  3891.  
  3892.        ck_keystat                                low level
  3893.        -------------------------------------------------------------------
  3894.        Summary:       #include "ckit.h"
  3895.                       short ck_keystat(void);
  3896.  
  3897.        Description:   Check if character is available from local console.
  3898.                       Does not wait for input.
  3899.  
  3900.        Return Value:  Returns 0 if none available, otherwise returns non-zero.
  3901.  
  3902.        See Also:      ck_input, ck_r_count, ck_key_source.
  3903.  
  3904.        Example:       This example checks for keypress at the keyboard
  3905.                       local console, returns TRUE or FALSE
  3906.  
  3907.        #include "ckit.h"
  3908.  
  3909.        main(int argc, char **argv) {
  3910.          if (argc > 1) {
  3911.            ck_open_door(argv[1]);
  3912.            .
  3913.            .
  3914.            .
  3915.            if ( ck_keystat() ) {
  3916.               return(FALSE);
  3917.            } else {
  3918.               return(TRUE);
  3919.            }
  3920.            .
  3921.            .
  3922.            .
  3923.            ck_close_door();
  3924.          };
  3925.        };
  3926.  
  3927.  
  3928.                                                                  Functions
  3929.  
  3930.        ck_r_count                                low level
  3931.        -------------------------------------------------------------------
  3932.        Summary:       #include "ckit.h"
  3933.                       short ck_r_count(void);
  3934.  
  3935.        Description:   Returns number of characters in receive queue.
  3936.                       Does not wait for input.
  3937.  
  3938.        Return Value:  Returns NULL if none available else returns number
  3939.                       of characters in the recieve queue.
  3940.  
  3941.        See Also:      ck_input, ck_r_count, ck_keystat.
  3942.  
  3943.        Example:       See ck_flush_rqueue below
  3944.  
  3945.  
  3946.  
  3947.                                                                  Functions
  3948.  
  3949.        ck_getkey                                 low level
  3950.        -------------------------------------------------------------------
  3951.        Summary:       #include "ckit.h"
  3952.                       size_t ck_getkey(void);
  3953.  
  3954.        Description:   Read character (if available)  from local console.
  3955.                       Does not wait for input.
  3956.  
  3957.        Return Value:  Returns FALSE if none available. Returns char. if avail.
  3958.  
  3959.        See Also:      ck_input, ck_getkey, ck_keystat, ck_check_CTRL_K
  3960.  
  3961.        Example:       This example read key from local console buffer and
  3962.                       print to screen.
  3963.  
  3964.        #include "ckit.h"
  3965.  
  3966.        size_t ch;
  3967.  
  3968.        main(int argc, char **argv) {
  3969.          if (argc > 1) {
  3970.            ck_open_door(argv[1]);
  3971.            .
  3972.            .
  3973.            .
  3974.            ch = getkey();
  3975.            ck_s_putc(ch);
  3976.            .
  3977.            .
  3978.            .
  3979.            ck_close_door();
  3980.          };
  3981.        };
  3982.  
  3983.  
  3984.  
  3985.                                                                  Functions
  3986.  
  3987.        ck_sio_getbyte                            low level
  3988.        -------------------------------------------------------------------
  3989.        Summary:       #include "ckit.h"
  3990.                       BYTE ck_sio_getbyte(void);
  3991.  
  3992.        Description:   Read character (if available)  from remote console.
  3993.                       Does not wait for input.
  3994.  
  3995.        Return Value:  Returns NULL if none available else returns
  3996.                       character read.
  3997.  
  3998.        See Also:      ck_input, ck_sio_getbyte, ck_keystat, ck_check_CTRL_K
  3999.  
  4000.        Example:       This example reads byte from remote console buffer
  4001.                       and displays it, if one was available.
  4002.  
  4003.        #include "ckit.h"
  4004.  
  4005.        BYTE ch;
  4006.        main(int argc, char **argv) {
  4007.          if (argc > 1) {
  4008.            ck_open_door(argv[1]);
  4009.            .
  4010.            .
  4011.            .
  4012.            ch = ck_sio_getbyte();
  4013.            if(ch) {
  4014.                  ck_s_putc(ch);
  4015.            };
  4016.            .
  4017.            .
  4018.            .
  4019.            ck_close_door();
  4020.          };
  4021.        };
  4022.  
  4023.  
  4024.  
  4025.        ck_lower_dtr                              low level
  4026.        -------------------------------------------------------------------
  4027.        Summary:       #include "ckit.h"
  4028.                       void ck_lower_dtr(void);
  4029.  
  4030.        Description:   Drops DTR on com port, causing modem to hang up.
  4031.  
  4032.        Return Value:  NONE
  4033.  
  4034.        See Also:        ck_raise_dtr, ck_transmit_modem, ck_transmit_data
  4035.  
  4036.        Example:
  4037.                         see ck_transmit_modem below
  4038.  
  4039.                                                                  Functions
  4040.  
  4041.  
  4042.        ck_raise_dtr                              low level
  4043.        -------------------------------------------------------------------
  4044.        Summary:       #include "ckit.h"
  4045.                       void ck_raise_dtr(void);
  4046.  
  4047.        Description:   Raises DTR on com port, causing modem to hang up.
  4048.  
  4049.        Return Value:  NONE
  4050.  
  4051.        See Also:        ck_lower_dtr, ck_transmit_modem, ck_transmit_data
  4052.  
  4053.        Example:
  4054.                         see ck_transmit_modem below
  4055.  
  4056.  
  4057.                                                                  Functions
  4058.  
  4059.  
  4060.        ck_force_offhook                          low level
  4061.        -------------------------------------------------------------------
  4062.        Summary:       #include "ckit.h"
  4063.                       void ck_force_offhook(void);
  4064.  
  4065.        Description:   Drops DTR on com port, causing modem to hang up,
  4066.                       tells modem to go back offhook.
  4067.                       This function will wait 1 second after dropping
  4068.                       dtr and 2 seconds after raising DTR before
  4069.                       telling modem to go offhook.  This is normally
  4070.                       handled automatically by C-KIT depeding on the
  4071.                       ck_FORCEOFFHOOK setting.
  4072.  
  4073.        Return Value:  NONE
  4074.  
  4075.        See Also:     ck_FORCEOFFHOOK above.
  4076.  
  4077.        Example:      Send a string to reset the modem if carrier
  4078.                      is lost.
  4079.  
  4080.        #include "ckit.h"
  4081.  
  4082.        main(int argc, char **argv) {
  4083.          if (argc > 1) {
  4084.            ck_open_door(argv[1]);
  4085.            .
  4086.            .
  4087.            .
  4088.            ck_force_offhook(); /* Dump user offline */
  4089.            .
  4090.            .
  4091.            .
  4092.          };
  4093.          ck_close_door();
  4094.        };
  4095.  
  4096.  
  4097.                                                                  Functions
  4098.  
  4099.  
  4100.        ck_transmit_data                          low level
  4101.        -------------------------------------------------------------------
  4102.        Summary:       #include "ckit.h"
  4103.                       void ck_transmit_data(BYTE *);
  4104.  
  4105.        Description:   Send C string to remote console.
  4106.                       No echo to local console. Expects a pointer to either
  4107.                       a NULL terminate C string of type BYTE or char.
  4108.                       Check for carrier included.  To send a single byte
  4109.                       use the sample code below.
  4110.  
  4111.        Return Value:  NONE
  4112.  
  4113.        See Also: ck_transmit_modem
  4114.  
  4115.        Example:
  4116.  
  4117.        #include "ckit.h"
  4118.  
  4119.        #define BEEP 0x07
  4120.  
  4121.        static char remote_msg[] = "HELLO";
  4122.  
  4123.        main(int argc, char **argv) {
  4124.          if (argc > 1) {
  4125.            ck_open_door(argv[1]);
  4126.            .
  4127.            .
  4128.            .
  4129.            ck_transmit_data(remote_msg);
  4130.            send_byte(BELL);
  4131.            .
  4132.            .
  4133.            .
  4134.          };
  4135.         ck_close_door();
  4136.        };
  4137.  
  4138. /* To send a single byte to the remote only use this code: */
  4139.  
  4140.        void    send_byte(BYTE data) {
  4141.           BYTE byte_out[2];
  4142.           *byte_out = data;
  4143.           *(byte_out+1) = 0x00;         /* Make a 'C' string */
  4144.           transmit_data(byte_out);
  4145.        }
  4146.  
  4147.  
  4148.        ck_transmit_modem                         low level
  4149.        -------------------------------------------------------------------
  4150.        Summary:       #include "ckit.h"
  4151.                       short ck_transmit_modem(BYTE *);
  4152.  
  4153.        Description:   Send C string to modem/remote.
  4154.                       No echo to local console. Expects a pointer to either
  4155.                       a NULL terminate C string of type BYTE or char.
  4156.                       NO carrier checking is included.  If it returns
  4157.                       Non-Zero if error occured, otherwise it returns NULL.
  4158.  
  4159.        Return Value:  NONE
  4160.  
  4161.        See Also: ck_transmit_data
  4162.  
  4163.        Example:
  4164.  
  4165.        #include "ckit.h"
  4166.  
  4167.        static char dialnumber[] = "ATDT6156908231";
  4168.        #include "ckit.h"
  4169.        main(int argc, char **argv) {
  4170.          if (argc > 1) {
  4171.            ck_open_door(argv[1]);
  4172.            .
  4173.            .
  4174.            .
  4175.            ck_debug_on();
  4176.            ck_lower_dtr();    /* Drop user off */
  4177.            ck_raise_dtr();
  4178.            ck_wait(1);     /* wait for modem to reset */
  4179.            ck_flush_RQUEUE(); /* Flush receive queue   */
  4180.            ck_transmit_modem(dialnumber);
  4181.            ck_debug_off();
  4182.            while(ck_tqueue_len()); /* wait on modem */
  4183.            ck_get_cmdline();
  4184.            strcmp(ck_cmdline, "CARRIER");
  4185.            .
  4186.            .
  4187.            .
  4188.          };
  4189.          ck_close_door();
  4190.        };
  4191.  
  4192.                                                          Functions
  4193.  
  4194.        ck_tqueue_len                             low level
  4195.        -------------------------------------------------------------------
  4196.        Summary:       #include "ckit.h"
  4197.                       short ck_tqueue_len(void);
  4198.  
  4199.        Description:   Check number of bytes left in Transmit RQUEUE.
  4200.                       Normally this routine is not needed but is available
  4201.                       if needed.
  4202.  
  4203.  
  4204.        Return Value:  Bytes left in XMIT QUEUE
  4205.  
  4206.        See Also:      
  4207.  
  4208.        Example:
  4209.  
  4210.        #include "ckit.h"
  4211.  
  4212.        static char modem_msg[] = "ATX4";
  4213.        main(int argc, char **argv) {
  4214.          if (argc > 1) {
  4215.            ck_open_door(argv[1]);
  4216.            .
  4217.            .
  4218.            .
  4219.            ck_debug_on();
  4220.            ck_transmit_modem(message);
  4221.            while(ck_tqueue_len());
  4222.            ck_debug_off();
  4223.            .
  4224.            .
  4225.            .
  4226.          };
  4227.         ck_close_door();
  4228.        };
  4229.  
  4230.  
  4231.                                                                  Functions
  4232.  
  4233.        ck_flush_RQUEUE                           low level
  4234.        -------------------------------------------------------------------
  4235.        Summary:       #include "ckit.h"
  4236.                       BYTE * ck_flush_RQUEUE(void);
  4237.  
  4238.        Description:   Flush bytes from Receive QUEUE buffer.
  4239.                       Also returns a near pointer to the receive queue buffer.
  4240.  
  4241.        Return Value:  NONE
  4242.  
  4243.        See Also: r_count, tqueue_len
  4244.  
  4245.        Example:
  4246.  
  4247.        #include "ckit.h"
  4248.  
  4249.        static char message[] = "ATH1";
  4250.  
  4251.        main(int argc, char **argv) {
  4252.          if (argc > 1) {
  4253.            ck_open_door(argv[1]);
  4254.            .
  4255.            .
  4256.            .
  4257.           ck_flush_RQUEUE();         /* flush buffer */
  4258.           ck_transmit_modem(message);
  4259.           while (ck_r_count());      /* wait for response back */
  4260.            .
  4261.            .
  4262.            .
  4263.          };
  4264.         ck_close_door();
  4265.        };
  4266.  
  4267.  
  4268.                                                                  Functions
  4269.  
  4270.        ck_flush_TQUEUE                           low level
  4271.        -------------------------------------------------------------------
  4272.        Summary:       #include "ckit.h"
  4273.                       void ck_flush_TQUEUE(void);
  4274.  
  4275.        Description:   Flush bytes from Transmit QUEUE buffer.
  4276.  
  4277.        Return Value:  NONE
  4278.  
  4279.        See Also: tqueue_len
  4280.  
  4281.        Example:
  4282.  
  4283.        #include "ckit.h"
  4284.  
  4285.        static char message[] = "ATH1";
  4286.  
  4287.        main(int argc, char **argv) {
  4288.          if (argc > 1) {
  4289.            ck_open_door(argv[1]);
  4290.            .
  4291.            .
  4292.            .
  4293.           ck_flush_RQUEUE();         /* flush buffer */
  4294.           ck_transmit_modem(message);
  4295.           while (ck_r_count());      /* wait for response back */
  4296.            .
  4297.            .
  4298.           ck_flush_TQUEUE();         /* flush buffer */
  4299.            .
  4300.          };
  4301.         ck_close_door();
  4302.        };
  4303.  
  4304.  
  4305.                                                                  Functions
  4306.  
  4307.        ck_check_cd                               low level
  4308.        -------------------------------------------------------------------
  4309.        Summary:       #include "ckit.h"
  4310.                       BYTE ck_check_cd(void);
  4311.  
  4312.        Description:   Checks if carrier present. If present, returns
  4313.                       NON-zero.  Zero (NULL) means no carrier present.
  4314.  
  4315.        Return Value:  BYTE indicator of carrier present.
  4316.  
  4317.        See Also: ck_DUMP_USER, ck_transmit_data, ck_transmit_modem
  4318.  
  4319.  
  4320.                                                                  Functions
  4321.  
  4322.        ck_check_keypress                         low level
  4323.        -------------------------------------------------------------------
  4324.        Summary:       #include "ckit.h"
  4325.                       short ck_check_keypress(BYTE);
  4326.  
  4327.        Description:   Check for any specific ASCII character entered.
  4328.                       Does not wait for a character.
  4329.  
  4330.                         This function may or may not be useful
  4331.                         but is available if needed for a "hot_key"
  4332.                         function in a door.  Does no carrier checking!
  4333.  
  4334.        Return Value:  TRUE, FALSE
  4335.  
  4336.        See also: ck_check_CR, ck_input(), ck_getkey()
  4337.                  ck_wait_keypress, ck_check_CTRL_K
  4338.  
  4339.        Example:
  4340.  
  4341.        #include "ckit.h"
  4342.  
  4343.        BYTE result;
  4344.  
  4345.        main(int argc, char **argv) {
  4346.          if (argc > 1) {
  4347.            ck_open_door(argv[1]);
  4348.            .
  4349.            .
  4350.            .
  4351.            while {
  4352.              !(result = ck_check_keypress(0x41));
  4353.            };
  4354.            printf("Keypress returned %d", result);
  4355.            .
  4356.            .
  4357.            .
  4358.          };
  4359.         ck_close_door();
  4360.        };
  4361.  
  4362.  
  4363.  
  4364.  
  4365.  
  4366.   C-KIT based DOOR programs have many of the feature available for the
  4367. door author, and for the sysop using standard function keys such as:
  4368.  
  4369.              Function key
  4370.              ------------
  4371.                 F5              Shell to DOS
  4372.                 F8              Return user to system
  4373.                 F9              Toggle display on/off
  4374.                 F10             Chat mode  (use the ESCAPE key to exit)
  4375.               * F3              Toggle printer on/off
  4376.               * F4              Toggle pagebell on/off
  4377.               * F7              Toggle caller alarm on/off
  4378.  
  4379.              Alternate key
  4380.              -------------
  4381.                ALT-H            Toggle between different status lines
  4382.  
  4383.              * ALT-N            Toggle sysop on next
  4384.              * ALT-X            Toggle exit to dos after call
  4385.                                 and help lines
  4386.         Alternately pressing the ALT-H key will bring up
  4387.         the next status line screen.  The 1st screen is a help screen,
  4388.         the second second screen shows your COM port status.
  4389.  
  4390.  * The function keys marked with an "*"  will only be of use to systems
  4391.    using pcboard.sys.  The rest are functional with any system.
  4392.  
  4393.   Command stacking is also available and can be easily disabled if desired.
  4394. See the CKITDEMO.C for example of disabling command stacking.
  4395.  
  4396.  
  4397.  
  4398.    ATTENTION TURBO C USERS:  In versions 2.01 and below you should use
  4399.    WORD alignment, in C-kit 2.08 and above you should use BYTE alignment.
  4400.    This applies if you are planning to use the ck_users structure AND/OR
  4401.    the ck_update_user() function. The default on BORLAND is BYTE alignment.
  4402.    This will not work correctly for these two items.  If you are not
  4403.    using either the ck_users file structure or ck_update_user();
  4404.    function, then you don't have to use WORD alignment, BYTE alignment
  4405.    will work OK.
  4406.    See the file TCREAD.ME in the CKIT_TC.ZIP file.
  4407.    In addition, TURBO C++/BC++ users should also select standard stack
  4408.    frame alignment.
  4409.    Make a dir to work from. Copy the CKITDEMO.C, CKITDEMO.H, CKIT.H,
  4410.    the CKIT_T?.LIB's, and the TCPPCKIT.PRJ or CKITS.PRJ into the
  4411.    same dir.  Bring up the TURBO C IDE and select the proper project
  4412.    file and you can test the CKITDEMO.C.  Have it create an .exe file.
  4413.    This should get you started.   You can take it from here...
  4414.  
  4415.    This package can be freely distributed so long as it is not modified
  4416.    or sold for profit.  If you find that this program is valuable,
  4417.    please register it by sending a minimum fee of $30.00
  4418.    (USA exchange).   You will receive a program CKITREG.EXE.
  4419.    This  will register all future copies of C-KIT with your registration
  4420.    number. This means you would only have to download the new versions
  4421.    from your favorite board, saving you long distance charges!
  4422.    Source code modules are available to registered users for reading
  4423.    other system files that you may want to include in your door program.
  4424.    (as they become available).  There is now a complete set of PCBoard
  4425.    source code modules. (users.sys, pcboard.dat etc)
  4426.  
  4427.    Send your contributions to:
  4428.  
  4429.       Rickie W. Belitz
  4430.       P.O. Box 5895
  4431.       Maryville, TN 37802-5895
  4432.  
  4433.                                  SUPPORT
  4434.                                -----------
  4435.  
  4436.    If you have any questions, suggestions, or bug reports, contact me at:
  4437.  
  4438.        Data-Comp BBS
  4439.        (615) 690-8231  (USR HST Dual Standard V.32bis 16.8)
  4440.  
  4441.  
  4442.    I can also be reached via mail networks thru INTELEC's BBS_DOORS conference
  4443.    and RIME's (Relaynet) DOORS conference.
  4444.  
  4445.  
  4446.                                ACKNOWLEDGEMENTS
  4447.                              --------------------
  4448.         I would like to give special thanks to my Co-sysop, Dean McGuire,
  4449.         who has patiently tested the door routines and for help preparing the
  4450.         documentation.
  4451.  
  4452.                                   GENERIC.SYS
  4453.                           --------------------------
  4454.    For maximum compatibility, C-KIT will also read a file called
  4455. GENERIC.SYS.  This file can be created by the sysop desiring to run
  4456. the door and allow C-KIT to operate.  This would allow your door to
  4457. operate on ANY BBS system.  (see compatibilty issues below).  The
  4458. GENERIC.SYS file is a standard ASCII file and contains 3 lines, each
  4459. followed by a carriage return, line feed.  The format is:
  4460.  
  4461.         line 1  -  The BBS operator's name.
  4462.         line 2  -  The COM port in use.
  4463.         line 3  -  Time allowed in door.
  4464.  
  4465. Below is an example GENERIC.SYS file with a sysop name of Rickie,
  4466. using Com port 1, and allowing 50 minutes in the door.
  4467.  
  4468. Rickie
  4469. COM1:
  4470. 50
  4471.  
  4472.   Each line is followed by a C/R, L/F and the com port follows the same
  4473. format as the standard door.sys.  COM0: = Local Mode (same as door.sys)
  4474. See the compatibilty issues below for more information.
  4475.  
  4476. NOTE: You should include this information in your door documentation also.
  4477.  
  4478.  
  4479.  
  4480.                              COMPATIBILITY ISSUES
  4481.                           --------------------------
  4482.    Although C-KIT makes a lot information available to the user, the author
  4483.  has to decide on what particular information his or her door will require.
  4484.  Here are some general guidelines that may help.  Decide on exactly what
  4485.  information your door will need to operate.  Keeping this to a minimum
  4486.  increases your chances of maintaining compatibility thruout the different
  4487.  BBS's systems and versions thereof which C-KIT supports.
  4488.  
  4489.    For example, let's assume you are designing a standard BBS game.  C-KIT
  4490.  handles all the detailed information such as time left, carrier detect etc.
  4491.  All you would really need is some basic information.  Perhaps just the
  4492.  user's name and sysop name.   By keeping this type of information to the
  4493.  minimum, your door would work regardless of whether the sysop running your
  4494.  door used pcboard.sys, door.sys, callinfo.bbs or GENERIC.SYS on the command
  4495.  line..i.e,  game.exe c:\pcb\pcboard.sys OR game.exe c:\pcb\door.sys OR
  4496.  game.exe c:\wc\callinfo.bbs, OR game.exe c:\GENERIC.SYS OR
  4497.  game.exe c:\rbbs\DORINFOx.DEF;,  ANY  of these would work.  (If the sysop
  4498.  was running PCBoard 12.0, he would only be able to use pcboard.sys.
  4499.  In this case, C-KIT would not only take care of deciding if it was a
  4500.  pcboard.sys file, door.sys file, WILDCAT! callinfo.bbs or DORINFOx.DEF, but
  4501.  also if it *is* a pcboard.sys file, whether it is a PCBoard 12.0 sys file
  4502.  or later, and then would read it properly!).   This would make your door
  4503.  compatible with the full spectrum of PCBoard 12.0-14.5, WILDCAT!, GAP,
  4504.  SPITFIRE 3.0, other systems using the standard door.sys file, RBBS and
  4505.  others using DORINFO1.DEF and ANY BBS using GENERIC.SYS with minimum effort
  4506.  on the part of the sysop running your door.  Once you've written this
  4507.  fantastic new door, if it's a snap for a Sysop to install it, this might
  4508.  make him a bit more inclined to register it, right?
  4509.  
  4510.    Another senario would be if your door needs somewhat more than the basic
  4511.  information.  I would recommend using the variables available in door.sys
  4512.  and WILDCAT! info file in this case.  This would give you the broadest
  4513.  coverage for your door. If you will notice in the variables descriptions
  4514.  in this manual, there is a compatibility list to the right of each variable.
  4515.  This tells you which and what type of information is available to you
  4516.  depending on whether your door found a door.sys, pcboard.sys (and which
  4517.  version of PCBoard), WILDCAT! info file and DORINFOx.DEF file.  Below
  4518.  is a summary and quick guide to each pcboard.sys version, door.sys,
  4519.  WILDCAT!, DORINFOx.DEF info file and which information variables are
  4520.  available with each.
  4521.  
  4522.    If you need EVEN more information, then you can tell C-KIT to open the
  4523.  users file and read information.  Doing so will limit your door to PCBoard
  4524.  systems only.  C-KIT will NOT record any information to the user's file
  4525.  unless a call to update_user has been made.  It will also not record anything
  4526.  to sysop record.
  4527.  
  4528.                   Compatible with...
  4529.                   ----------------------------------------------------------
  4530.     "ck_"         PCBoard.sys
  4531.    Variables      12.0  14.0-14.5  DOOR.SYS  WILDCAT! DORINFOx.DEF GENERIC.SYS
  4532.  --------------   ----  --------   --------  -------  -----------  -----------
  4533.  *conferences                          X         X
  4534.  aport              X     X            X         X      X             X
  4535.  ansi_ng                               X
  4536.  BBSname                                                X
  4537.  bps_open                 X            X         X
  4538.  baud_rate          X     X            X         X      X
  4539.  callalarm          X     X            X
  4540.  current_conf       X     X            X
  4541.  caller_bday                           X         X
  4542.  display            X     X            X         X      X
  4543.  default_color                         X
  4544.  daily_bytes                           X         X
  4545.  daily_files                           X         X
  4546.  download_Kbytes                       X         X
  4547.  door_opened                                     X
  4548.  DOTS               X     X            X         X      X             X
  4549.  dload_total              X            X         X
  4550.  error_connection   X     X            X         X
  4551.  expert             X     X            X         X
  4552.  event_active             X
  4553.  event_slide              X
  4554.  event_time               X            X         X
  4555.  firstname          X     X            X         X      X             X
  4556.  fullname           X     X            X         X      X             X
  4557.  graphics           X     X            X         X      X
  4558.  gen_dir                               X
  4559.  high_msg                                        X
  4560.  key_source         X     X            X         X      X
  4561.  local              X     X            X         X      X
  4562.  logoff_color       X     X            X         X
  4563.  exit_msg           X     X            X         X      X
  4564.  language           X     X
  4565.  last_file_scan     X     X            X         X
  4566.  min_left           X     X            X         X      X             X
  4567.  main_dir                              X
  4568.  max_files                             X
  4569.  max_sec                                         X
  4570.  monitor_type                                    X
  4571.  msgs_left                             X
  4572.  name_in_use                                     X
  4573.  netchat            X     X
  4574.  node                     X            X         X      X
  4575.  NO_FKEYS           X     X            X         X      X             X
  4576.  NOSYSTEM           X     X            X         X      X             X
  4577.  printer            X     X            X
  4578.  protocol           X     X            X         X
  4579.  pagebell           X     X            X
  4580.  password           X     X            X         X
  4581.  page_length        X     X            X         X      X
  4582.  PCB                X     X            X         X      X
  4583.  PCB12              X     X            X         X      X
  4584.  prev_used                X
  4585.  port               X     X            X         X      X
  4586.  parity                                X         X
  4587.  RBBS               X     X            X         X      X             X
  4588.  record_lock                           X
  4589.  scan_code          X     X            X         X      X
  4590.  security_level                        X         X      X
  4591.  silent             X     X            X         X      X             X
  4592.  sysop_next         X     X
  4593.  sysop_name                            X                X             X
  4594.  sysop_alias                           X
  4595.  time_logged        X     X            X         X      X
  4596.  time_on            X     X
  4597.  time_limit         X     X
  4598.  time_added         X     X
  4599.  total_doors                           X
  4600.  user_record        X     X            X         X
  4601.  upload_Kbytes                         X
  4602.  upload_total             X            X         X
  4603.  ck_usercomment1                       X
  4604.  WILDCAT            X     X            X         X      X
  4605.  
  4606.  One last note - There are four variables PCB12, PCB, WILDCAT and GAP.  When
  4607.  C-KIT reads a pcboard.sys file, it will set the PCB variable TRUE.  If the
  4608.  pcboard.sys file it read was a 12.0 file, it will set the PCB12 variable true.
  4609.  If C-KIT finds a WILDCAT system, it will set the variable WILDCAT true.  This
  4610.  may be useful in making adjustments to your program depending on which system
  4611.  file was read (PCB, DOOR.SYS, PCB12, WILDCAT)  and/or if a sysop was running
  4612.  PCBoard 12.0 and you normally expected door.sys or wildcat info file.
  4613.  If C-KIT finds a door.sys file, GAP will be set true.
  4614.  
  4615.  Also, see the users file information earlier in the doc file.  Some of the
  4616.  users structure information is available even if you are just using door.sys.
  4617.  If you do tell C-KIT to open the users file, all the users file information
  4618.  above will be available, if C-KIT finds a version 14.x pcboard.sys.  If it
  4619.  finds a PCBoard 12.0 pcboard.sys file, some, but not all, of the users
  4620.  structure information will be available.  Each member of the users structure
  4621.  is marked to indicate what is available and what is not depending on the
  4622.  things just mentioned.
  4623.  
  4624.  
  4625.                                                                   Warranty
  4626.  
  4627.                                   Warranty
  4628.                                 ------------
  4629.        I make no warranty of any kind, express or implied, including
  4630.        without limitation, any warranties of merchantability and/or
  4631.        fitness for a particular purpose.  I shall not be held liable for
  4632.        any  damages, whether direct, indirect, special or consequential
  4633.        arising from a failure  of this program to operate in the manner
  4634.        desired by the user.  I shall not be held liable for any damage to
  4635.        data or property which may be caused directly or indirectly by the
  4636.        use of this program.
  4637.  
  4638.        In no event will I be held liable for any damages, including (but
  4639.        not limited to) any lost profits, lost savings or other incidental
  4640.        or consequential damages arising out of the use or inability to
  4641.        use this program, or for any claim by any other party.
  4642.  
  4643.        This warranty is governed by the laws of the State of Tennessee.
  4644.  
  4645.  
  4646.                                  ORDER.FRM       v2.58
  4647.                                -------------
  4648.  
  4649.                                    Return to:     Rickie Belitz
  4650.                                                   P.O. Box 5895
  4651.                                                   Maryville, TN 37802-5895
  4652.  
  4653.   Name ______________________________________________________________
  4654.  
  4655.   Company ___________________________________________________________
  4656.  
  4657.   Address ___________________________________________________________
  4658.  
  4659.           ___________________________________________________________
  4660.  
  4661.   Phone _____________________________________________________________
  4662.  
  4663.   Register C-KIT to:  Name____________________________________________
  4664.  
  4665.   Diskette size:  ____ 5.25" acceptable       ____ 3.5" required*
  4666.  
  4667.   Orders outside the USA add $4.00                         _________
  4668.  
  4669.   *Add $2.00 for 3.5"                                      _________
  4670.  
  4671.       Please find enclosed a check or money order for USA $_________
  4672.   ($30.00 minimum)   payable to Rickie Belitz.  This shows my support
  4673.   of Shareware products and the Shareware concept.  It also shows my
  4674.   encouragement to help further development of C-KIT.
  4675.  
  4676.       I understand that C-KIT is provided as-is and no warranties of
  4677.   any kind, expressed or otherwise, are included and that I am using
  4678.   it at my own risk.
  4679.  
  4680.   Signed: _________________________________________  Date: _________
  4681.  
  4682.  
  4683.  
  4684.                                  RELEASE HISTORY
  4685.                                -------------------
  4686.                                 see history file
  4687.  
  4688.  
  4689.                           SOME COMMON PROBLEMS/QUESTIONS
  4690.                           ------------------------------
  4691. Q. How can a test my door in "local" mode?
  4692.  
  4693. A. There is a door.sys file included with the C-KIT libraries.
  4694.    The first line in the door.sys file is COM0:.  With accordance
  4695.    to doorsys specs., this specifies "local" mode.  Use this file
  4696.    for testing your doors.  You can modify the door.sys
  4697.    file to also use a com port for online testing.  See the
  4698.    doorsys.txt for more information.  You could also make up a
  4699.    GENERIC.SYS file and use COM0: as the port.  See the section
  4700.    on GENERIC.SYS.
  4701.  
  4702. Q. When linking my code with the library I get a linker error -
  4703.    Unresolved external _progname in CKIT3.ASM.
  4704.  
  4705. A. C-KIT will look for a C string array called progname[21];.  This the
  4706.    name of your door program and will appear at the bottom of the local
  4707.    line.  This is not an option.  You must declare some kind of name
  4708.    for C-KIT to use even if it just a space char if you don't want your
  4709.    progname at the bottom.  See the CKIDEMO.H file for example and
  4710.    the variable progname[] in the doc file.
  4711.  
  4712. Q. When linking your ckitdemo program, I get an error -
  4713.    Unresolved external _random in ckitdemo.c
  4714.  
  4715. A. The Ckitdemo.c door was written to be compiled with either Microsoft C
  4716.    or Turbo C.  As such, there are compiler directives in the CKITDEMO.C
  4717.    file that will take appropriate action depending on the compiler.
  4718.    Therefore, when compiling the CKITDEMO.C program, you must have the
  4719.    statement -DCOMPILER=MICROSOFT or -DCOMPILER=TURBOC on the command
  4720.    line.   This is needed only when compiling the CKITDEMO.C program.
  4721.    It is NOT needed when you are compiling your own door program.
  4722.  
  4723. Q. Do I have to include the -DCOMPILER-MICROSOFT or -DCOMPILER=TURBOC
  4724.    on the command line every time I compile my door program?
  4725.  
  4726. A. No, this was only needed for the CKITDEMO.C source code.  You can
  4727.    also modify the ckitdemo.c and ckitdemo.h file and take the compiler
  4728.    directives out if you like.  Then you would not have to use it when
  4729.    compiling the ckitdemo.c.  (Just make sure you take the right ones
  4730.    out for whichever compiler you are using). Matter fact, the way
  4731.    the defaults are defined in CKITDEMO.C, and CKITDEMO.H you don't
  4732.    need to have the -DCOMPILER=TURBOC when using TURBO C to compile
  4733.    the ckitdemo.c file or using Turbo C's IDE.
  4734.  
  4735. Q. My F4, F3, F7, ALT X, ALT N keys do not do have any effect when
  4736.    returning to the BBS.
  4737.  
  4738. A. These keys are valid only on doors or sysops using the pcboard.sys
  4739.    file.  When the code finds a door.sys or Wildcat! info files, it
  4740.    will make no attempt to update a pcboard.sys file.
  4741.    F5 shell to DOS, F8 return to BBS, F9 screen on/off will work
  4742.    with any system.  Try and write your door so that the sysop
  4743.    can use pcboard.sys if he is a PCBoard sysop but will also run
  4744.    on other systems as well.  Future updates will take into consideration
  4745.    other systems as permitted.  See the compatibility chart above.
  4746.  
  4747. Q. Why all the formfeeds in the documentation?
  4748.  
  4749. A. This is so that people with access to a copier can print them out,
  4750.    run the printed sheets thru the copier and duplex (print on both
  4751.    sides) the sheets into a manual.  If you do not want the form
  4752.    feeds, just do a global replacement with your favorite editor
  4753.    and get rid of them.
  4754.  
  4755. Q. I thought C-KIT required that the users file path be listed also?
  4756.  
  4757. A. NO.  This was used for the CKITDEMO file only. C-KIT
  4758.         library does not care one way or another about the users
  4759.         file being open.  CKITDEMO is also written to work with ANY
  4760.         system.  Ckitdemo is a demostration of how a door can be
  4761.         written to accept any command line given and make adjustments
  4762.         accordingly.  Ckitdemo will accept either:
  4763.         ckitdemo.exe c:\pcb\pcboard.sys c:\pcb\main\users
  4764.         ckitdemo.exe c:\pcb\door.sys
  4765.         ckitdemo.exe c:\wc\callinfo.bbs PORT:03e8:5
  4766.         See the open_door() function for more information.
  4767.  
  4768.  
  4769. Q. Will C-KIT work with any systems users file?
  4770.  
  4771. A. NO.  If you require information from the user file it must be
  4772.         be PCBoard 14.x or PCBoard 12.0.  However, by doing so
  4773.         you will be limiting your door to the number of systems
  4774.         it can be ran on.  I would not recommend using user file
  4775.         info unless your door is being written specifically for
  4776.         PCBoard.  Other system files (pcboard.dat, msgs and
  4777.         other systems users file) will be included in the form of
  4778.         source code at a later date.  This will allow you to
  4779.         link those with the existing C-KIT library functions.
  4780.  
  4781. Q. What baud rates can C-KIT can handle?
  4782.  
  4783. A.     C-KIT can handle ANY baud rate from 50 baud to 230K baud.
  4784.        (these are the baud rates it has been used with).  The highest
  4785.        baud any standard IBM compt. system can produce is 115K
  4786.        baud.  The 230K baud was done on a modified IBM AT by changing
  4787.        the UART's xtal and using 16550A UARTs.
  4788.  
  4789. Q. I'm using MSC 6.0 and when I compile my program I get a message
  4790.    "warning 'NULL' : macro redefinition"?
  4791.  
  4792. A. This is not a problem.  It is actually a carry over from MSC5.1.
  4793.    If you wish, you can remove the line #define NULL = 0 in the CKIT.H
  4794.    header file. MSC 6.0 redefined their NULL assignment in the stdlib.h
  4795.    file which causes this.  You will not get the warning with MSC 5.1
  4796.    or lower and TURBO C.
  4797.  
  4798. Q. I'm using TURBOC and when I compile the small model demo program
  4799.    it works fine.  But when I re-compile using medium model I get
  4800.    stack overflow fixup errors from the linker.
  4801.  
  4802. A. TurboC does not delete and re-compile the CKITDEMO.C module.
  4803.    So when it attempts to link the older small model .obj file you created
  4804.    earlier with the medium library, you will get this error.  When
  4805.    you switch memory models, you must delete the previous .obj file
  4806.    created using the small memory model.  If this happened to be
  4807.    CKITDEMO.C, you would need to delete CKITDEMO.OBJ before changing
  4808.    memory models.
  4809.  
  4810. Q. Some function keys are not trapped locally.
  4811.  
  4812. A. Some keys are reserved on the local keyboard for sysop functions.
  4813.    Try to design your door without using the F3, F4, F5, F7, F8, F9
  4814.    ALT-H, ALT-N, ALT-X.   If you have to use these keys, they can
  4815.    be used by the remote keyboard but just be aware, you would not
  4816.    be able to use them on your local keyboard.
  4817.  
  4818. Q. When linking my program, I get an error -
  4819.    Unresolved external _wait.
  4820.  
  4821. A. This function was renamed to ck_wait in v1.7.  You need to
  4822.    be using the CKIT.h header file.  There was a conflict with
  4823.    one of Borland's library names.
  4824.  
  4825. Q. Why does the user security level somtimes show on the status line
  4826.    and sometimes it doesn't?
  4827.  
  4828. A. PCBoard.sys file does not provide that information.  The security
  4829.    level will only show if you are using door.sys, callinfo.bbs  (WILDCAT!)
  4830.    or you are using pcboard.sys and open the users file.
  4831.    The status line indicators for pagebell, printer and caller alarm
  4832.    will also not show up if you are using door.sys or callinfo.bbs
  4833.    but will if you are using any version of pcboard.sys from 12.0 up.
  4834.  
  4835. Q. Will there be any kind of sign off message from C-KIT after the program
  4836.    is registered?
  4837.  
  4838. A. After C-KIT is registered, the only message displayed when closing the
  4839.    door will be the one you defined using the *ck_logoff_msgs or the
  4840.    default   "Returning to system ...".
  4841.